Skip to content

Commit

Permalink
Updated the changelog.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhrubajyoti Sadhu committed Aug 16, 2023
1 parent 5831a5f commit d6c5564
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public Object monitor(ProceedingJoinPoint pjp) throws Throwable {
public Object monitor(ProceedingJoinPoint pjp, Monitored monitored) throws Throwable {

String metricBasePath = buildMetricBasePath(pjp);
String metricWithTagBasePath = buildMetricWithTagsBasePath(pjp);
String className = getClassName(pjp);
String methodName = getMethodName(pjp);

String result = null;
Expand All @@ -73,9 +73,9 @@ public Object monitor(ProceedingJoinPoint pjp, Monitored monitored) throws Throw
stopwatch.elapsed(TimeUnit.MILLISECONDS));

// Sends metrics with Tags: federation_namespace and method_name
incrementWithTags(buildMetricPath(COUNTER, metricWithTagBasePath, "calls"), methodName);
incrementWithTags(buildMetricPath(COUNTER, metricWithTagBasePath, result), methodName);
submitWithTags(buildMetricPath(TIMER, metricWithTagBasePath, "duration"),
incrementWithTags(buildMetricPath(COUNTER, className, "calls"), methodName);
incrementWithTags(buildMetricPath(COUNTER, className, result), methodName);
submitWithTags(buildMetricPath(TIMER, className, "duration"),
stopwatch.elapsed(TimeUnit.MILLISECONDS), methodName);
}
}
Expand Down Expand Up @@ -118,13 +118,11 @@ private Tags getMetricsTags(String methodName) {
}

private String getMethodName(ProceedingJoinPoint pjp) {
String methodName = clean(pjp.getSignature().getName());
return new StringBuilder(methodName).toString();
return clean(pjp.getSignature().getName());
}

private String getClassName(ProceedingJoinPoint pjp) {
String className = clean(pjp.getSignature().getDeclaringTypeName());
return new StringBuilder(className).toString();
return clean(pjp.getSignature().getDeclaringTypeName());
}

private String buildMetricWithTagsBasePath(ProceedingJoinPoint pjp) {
Expand Down

0 comments on commit d6c5564

Please sign in to comment.