Skip to content

Commit

Permalink
CatEventType 名字修正
Browse files Browse the repository at this point in the history
  • Loading branch information
powerYao committed Aug 21, 2017
1 parent 933150a commit 98c5ddb
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.ctrip.framework.apollo.common.entity.App;
import com.ctrip.framework.apollo.common.exception.BadRequestException;
import com.ctrip.framework.apollo.common.exception.ServiceException;
import com.ctrip.framework.apollo.common.utils.BeanUtils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.ctrip.framework.apollo.core.MetaDomainConsts;
import com.ctrip.framework.apollo.core.dto.ServiceDTO;
import com.ctrip.framework.apollo.core.enums.Env;
import com.ctrip.framework.apollo.portal.constant.CatEventType;
import com.ctrip.framework.apollo.portal.constant.TracerEventType;
import com.ctrip.framework.apollo.tracer.Tracer;
import com.ctrip.framework.apollo.tracer.spi.Transaction;

Expand Down Expand Up @@ -101,7 +101,7 @@ private <T> T execute(HttpMethod method, Env env, String path, Object request, C
logger.error("Http request failed, uri: {}, method: {}", uri, method, t);
Tracer.logError(t);
if (canRetry(t, method)) {
Tracer.logEvent(CatEventType.API_RETRY, uri);
Tracer.logEvent(TracerEventType.API_RETRY, uri);
} else {//biz exception rethrow
ct.setStatus(t);
ct.complete();
Expand Down Expand Up @@ -144,7 +144,7 @@ private <T> ResponseEntity<T> exchangeGet(Env env, String path, ParameterizedTyp
logger.error("Http request failed, uri: {}, method: {}", uri, HttpMethod.GET, t);
Tracer.logError(t);
if (canRetry(t, HttpMethod.GET)) {
Tracer.logEvent(CatEventType.API_RETRY, uri);
Tracer.logEvent(TracerEventType.API_RETRY, uri);
} else {// biz exception rethrow
ct.setStatus(t);
ct.complete();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.ctrip.framework.apollo.portal.constant;

public interface CatEventType {
public interface TracerEventType {

String RELEASE_NAMESPACE = "Namespace.Release";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.ctrip.framework.apollo.common.utils.BeanUtils;
import com.ctrip.framework.apollo.core.enums.Env;
import com.ctrip.framework.apollo.portal.api.AdminServiceAPI;
import com.ctrip.framework.apollo.portal.constant.CatEventType;
import com.ctrip.framework.apollo.portal.constant.TracerEventType;
import com.ctrip.framework.apollo.portal.entity.bo.UserInfo;
import com.ctrip.framework.apollo.portal.entity.vo.EnvClusterInfo;
import com.ctrip.framework.apollo.portal.repository.AppRepository;
Expand Down Expand Up @@ -101,7 +101,7 @@ public App createAppInLocal(App app) {
appNamespaceService.createDefaultAppNamespace(appId);
roleInitializationService.initAppRoles(createdApp);

Tracer.logEvent(CatEventType.CREATE_APP, appId);
Tracer.logEvent(TracerEventType.CREATE_APP, appId);

return createdApp;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.ctrip.framework.apollo.common.exception.BadRequestException;
import com.ctrip.framework.apollo.core.enums.Env;
import com.ctrip.framework.apollo.portal.api.AdminServiceAPI;
import com.ctrip.framework.apollo.portal.constant.CatEventType;
import com.ctrip.framework.apollo.portal.constant.TracerEventType;
import com.ctrip.framework.apollo.portal.spi.UserInfoHolder;
import com.ctrip.framework.apollo.tracer.Tracer;

Expand All @@ -31,7 +31,7 @@ public ClusterDTO createCluster(Env env, ClusterDTO cluster) {
}
ClusterDTO clusterDTO = clusterAPI.create(env, cluster);

Tracer.logEvent(CatEventType.CREATE_CLUSTER, cluster.getAppId(), "0", cluster.getName());
Tracer.logEvent(TracerEventType.CREATE_CLUSTER, cluster.getAppId(), "0", cluster.getName());

return clusterDTO;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import com.ctrip.framework.apollo.core.utils.StringUtils;
import com.ctrip.framework.apollo.portal.api.AdminServiceAPI;
import com.ctrip.framework.apollo.portal.component.txtresolver.ConfigTextResolver;
import com.ctrip.framework.apollo.portal.constant.CatEventType;
import com.ctrip.framework.apollo.portal.constant.TracerEventType;
import com.ctrip.framework.apollo.portal.entity.model.NamespaceTextModel;
import com.ctrip.framework.apollo.portal.entity.vo.ItemDiffs;
import com.ctrip.framework.apollo.portal.entity.vo.NamespaceIdentifier;
Expand Down Expand Up @@ -73,9 +73,9 @@ public void updateConfigItemByText(NamespaceTextModel model) {
changeSets.setDataChangeLastModifiedBy(userInfoHolder.getUser().getUserId());
updateItems(appId, env, clusterName, namespaceName, changeSets);

Tracer.logEvent(CatEventType.MODIFY_NAMESPACE_BY_TEXT,
Tracer.logEvent(TracerEventType.MODIFY_NAMESPACE_BY_TEXT,
String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName));
Tracer.logEvent(CatEventType.MODIFY_NAMESPACE, String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName));
Tracer.logEvent(TracerEventType.MODIFY_NAMESPACE, String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName));
}

public void updateItems(String appId, Env env, String clusterName, String namespaceName, ItemChangeSets changeSets){
Expand All @@ -92,7 +92,7 @@ public ItemDTO createItem(String appId, Env env, String clusterName, String name
item.setNamespaceId(namespace.getId());

ItemDTO itemDTO = itemAPI.createItem(appId, env, clusterName, namespaceName, item);
Tracer.logEvent(CatEventType.MODIFY_NAMESPACE, String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName));
Tracer.logEvent(TracerEventType.MODIFY_NAMESPACE, String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName));
return itemDTO;
}

Expand Down Expand Up @@ -126,7 +126,7 @@ public void syncItems(List<NamespaceIdentifier> comparedNamespaces, List<ItemDTO

itemAPI.updateItemsByChangeSet(appId, env, clusterName, namespaceName, changeSets);

Tracer.logEvent(CatEventType.SYNC_NAMESPACE, String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName));
Tracer.logEvent(TracerEventType.SYNC_NAMESPACE, String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.ctrip.framework.apollo.core.enums.Env;
import com.ctrip.framework.apollo.portal.api.AdminServiceAPI;
import com.ctrip.framework.apollo.portal.component.ItemsComparator;
import com.ctrip.framework.apollo.portal.constant.CatEventType;
import com.ctrip.framework.apollo.portal.constant.TracerEventType;
import com.ctrip.framework.apollo.portal.entity.bo.NamespaceBO;
import com.ctrip.framework.apollo.portal.spi.UserInfoHolder;
import com.ctrip.framework.apollo.tracer.Tracer;
Expand Down Expand Up @@ -43,7 +43,7 @@ public NamespaceDTO createBranch(String appId, Env env, String parentClusterName
NamespaceDTO createdBranch = namespaceBranchAPI.createBranch(appId, env, parentClusterName, namespaceName,
userInfoHolder.getUser().getUserId());

Tracer.logEvent(CatEventType.CREATE_GRAY_RELEASE, String.format("%s+%s+%s+%s", appId, env, parentClusterName,
Tracer.logEvent(TracerEventType.CREATE_GRAY_RELEASE, String.format("%s+%s+%s+%s", appId, env, parentClusterName,
namespaceName));
return createdBranch;

Expand All @@ -64,7 +64,7 @@ public void updateBranchGrayRules(String appId, Env env, String clusterName, Str

namespaceBranchAPI.updateBranchGrayRules(appId, env, clusterName, namespaceName, branchName, rules);

Tracer.logEvent(CatEventType.UPDATE_GRAY_RELEASE_RULE,
Tracer.logEvent(TracerEventType.UPDATE_GRAY_RELEASE_RULE,
String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName));
}

Expand All @@ -75,7 +75,7 @@ public void deleteBranch(String appId, Env env, String clusterName, String names

namespaceBranchAPI.deleteBranch(appId, env, clusterName, namespaceName, branchName, operator);

Tracer.logEvent(CatEventType.DELETE_GRAY_RELEASE,
Tracer.logEvent(TracerEventType.DELETE_GRAY_RELEASE,
String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName));
}

Expand All @@ -90,7 +90,7 @@ public ReleaseDTO merge(String appId, Env env, String clusterName, String namesp
releaseService.updateAndPublish(appId, env, clusterName, namespaceName, title, comment,
branchName, isEmergencyPublish, deleteBranch, changeSets);

Tracer.logEvent(CatEventType.MERGE_GRAY_RELEASE,
Tracer.logEvent(TracerEventType.MERGE_GRAY_RELEASE,
String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName));

return mergedResult;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import com.ctrip.framework.apollo.core.utils.StringUtils;
import com.ctrip.framework.apollo.portal.api.AdminServiceAPI;
import com.ctrip.framework.apollo.portal.component.PortalSettings;
import com.ctrip.framework.apollo.portal.constant.CatEventType;
import com.ctrip.framework.apollo.portal.constant.TracerEventType;
import com.ctrip.framework.apollo.portal.entity.bo.ItemBO;
import com.ctrip.framework.apollo.portal.entity.bo.NamespaceBO;
import com.ctrip.framework.apollo.portal.spi.UserInfoHolder;
Expand Down Expand Up @@ -64,7 +64,7 @@ public NamespaceDTO createNamespace(Env env, NamespaceDTO namespace) {
namespace.setDataChangeLastModifiedBy(userInfoHolder.getUser().getUserId());
NamespaceDTO createdNamespace = namespaceAPI.createNamespace(env, namespace);

Tracer.logEvent(CatEventType.CREATE_NAMESPACE,
Tracer.logEvent(TracerEventType.CREATE_NAMESPACE,
String.format("%s+%s+%s+%s", namespace.getAppId(), env, namespace.getClusterName(),
namespace.getNamespaceName()));
return createdNamespace;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.ctrip.framework.apollo.core.enums.Env;
import com.ctrip.framework.apollo.core.utils.StringUtils;
import com.ctrip.framework.apollo.portal.api.AdminServiceAPI;
import com.ctrip.framework.apollo.portal.constant.CatEventType;
import com.ctrip.framework.apollo.portal.constant.TracerEventType;
import com.ctrip.framework.apollo.portal.entity.model.NamespaceReleaseModel;
import com.ctrip.framework.apollo.portal.entity.bo.KVEntity;
import com.ctrip.framework.apollo.portal.entity.vo.ReleaseCompareResult;
Expand Down Expand Up @@ -54,7 +54,7 @@ public ReleaseDTO publish(NamespaceReleaseModel model) {
model.getReleaseTitle(), model.getReleaseComment(),
releaseBy, isEmergencyPublish);

Tracer.logEvent(CatEventType.RELEASE_NAMESPACE,
Tracer.logEvent(TracerEventType.RELEASE_NAMESPACE,
String.format("%s+%s+%s+%s", appId, env, clusterName, namespaceName));

return releaseDTO;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.ctrip.framework.apollo.portal.spi.ctrip.filters;

import com.ctrip.framework.apollo.portal.constant.CatEventType;
import com.ctrip.framework.apollo.portal.constant.TracerEventType;
import com.ctrip.framework.apollo.portal.entity.bo.UserInfo;
import com.ctrip.framework.apollo.portal.spi.UserInfoHolder;
import com.ctrip.framework.apollo.tracer.Tracer;
Expand Down Expand Up @@ -37,7 +37,7 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
if (!isOpenAPIRequest(requestUri) && !isStaticResource(requestUri)) {
UserInfo userInfo = userInfoHolder.getUser();
if (userInfo != null) {
Tracer.logEvent(CatEventType.USER_ACCESS, userInfo.getUserId());
Tracer.logEvent(TracerEventType.USER_ACCESS, userInfo.getUserId());
}
}
} catch (Throwable e) {
Expand Down

0 comments on commit 98c5ddb

Please sign in to comment.