Skip to content

Commit

Permalink
[#9633] Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
emeroad committed Jan 16, 2023
1 parent 01cae35 commit 1ffb662
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,9 @@ private boolean initScope(final Trace trace) {
}

private void entryScope(final Trace trace) {
if (ScopeUtils.entryScope(trace, this.scopeName)) {
if (isDebug) {
logger.debug("Try enter trace scope={}", scopeName);
}
ScopeUtils.entryScope(trace, this.scopeName);
if (isDebug) {
logger.debug("Try enter trace scope={}", scopeName);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,15 @@ public final class ScopeUtils {
private ScopeUtils() {
}

public static boolean entryAsyncTraceScope(final Trace trace) {
return entryScope(trace, ASYNC_TRACE_SCOPE);
public static void entryAsyncTraceScope(final Trace trace) {
entryScope(trace, ASYNC_TRACE_SCOPE);
}

public static boolean entryScope(final Trace trace, final String scopeName) {
public static void entryScope(final Trace trace, final String scopeName) {
final TraceScope scope = trace.getScope(scopeName);
if (scope != null) {
scope.tryEnter();
return true;
}
return false;
}

public static boolean leaveAsyncTraceScope(final Trace trace) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,9 @@ private boolean initScope(final Trace trace) {
}

private void entryScope(final Trace trace) {
if (ScopeUtils.entryScope(trace, SCOPE_NAME)) {
if (isDebug) {
logger.debug("Try enter trace scope={}", SCOPE_NAME);
}
ScopeUtils.entryScope(trace, SCOPE_NAME);
if (isDebug) {
logger.debug("Try enter trace scope={}", SCOPE_NAME);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,9 @@ private boolean initScope(final Trace trace) {
}

private void entryScope(final Trace trace) {
if (ScopeUtils.entryScope(trace, SCOPE_NAME)) {
if (isDebug) {
logger.debug("Try enter trace scope={}", SCOPE_NAME);
}
ScopeUtils.entryScope(trace, SCOPE_NAME);
if (isDebug) {
logger.debug("Try enter trace scope={}", SCOPE_NAME);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,9 @@ private void deleteUserIncludeTrace(final Trace trace) {
}

private void entryUserIncludeTraceScope(final Trace trace) {
if (ScopeUtils.entryScope(trace, SCOPE_NAME)) {
if (isDebug) {
logger.debug("Try enter trace scope={}", SCOPE_NAME);
}
ScopeUtils.entryScope(trace, SCOPE_NAME);
if (isDebug) {
logger.debug("Try enter trace scope={}", SCOPE_NAME);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,9 @@ private boolean initScope(final Trace trace) {
}

private void entryScope(final Trace trace) {
if (ScopeUtils.entryScope(trace, SCOPE_NAME)) {
if (isDebug) {
logger.debug("Try enter trace scope={}", SCOPE_NAME);
}
ScopeUtils.entryScope(trace, SCOPE_NAME);
if (isDebug) {
logger.debug("Try enter trace scope={}", SCOPE_NAME);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ public Shared getShared() {

@Override
public String toString() {
return "DefaultLocalTraceRoot{" +
", agentId='" + agentId + '\'' +
return "LocalTraceRootImpl{" +
"agentId='" + agentId + '\'' +
", localTransactionId=" + localTransactionId +
", traceStartTime=" + traceStartTime +
", shared=" + shared +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ public TraceId getTraceId() {

@Override
public String toString() {
return "DefaultRemoteTraceRoot{" +
return "RemoteTraceRootImpl{" +
"traceId=" + traceId +
", agentId='" + agentId + '\'' +
", localTransactionId=" + localTransactionId +
", traceStartTime=" + traceStartTime +
", shared=" + shared +
'}';
}

Expand Down

0 comments on commit 1ffb662

Please sign in to comment.