forked from flipkart-incubator/Poseidon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed the format of status code metrics
- Loading branch information
1 parent
7e0787c
commit 1180e1d
Showing
3 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
container/src/main/java/com/flipkart/poseidon/helpers/MetricsHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.flipkart.poseidon.helpers; | ||
|
||
/** | ||
* Created by shubham.srivastava on 19/04/17. | ||
*/ | ||
public class MetricsHelper { | ||
|
||
private static String BASE_METRICS_NAME = "poseidon.api."; | ||
private static String DEFAULT_DELIMITER = "."; | ||
|
||
public static String getStatusCodeMetricsName(String endpoint, String method, String status) { | ||
return new StringBuilder(BASE_METRICS_NAME) | ||
.append(endpoint) | ||
.append(method) | ||
.append(DEFAULT_DELIMITER) | ||
.append(status) | ||
.toString(); | ||
} | ||
|
||
public static String getApiTimerMetricsName(String endpoint, String method) { | ||
return new StringBuilder(BASE_METRICS_NAME) | ||
.append(endpoint) | ||
.append(DEFAULT_DELIMITER) | ||
.append(method) | ||
.toString(); | ||
} | ||
|
||
} |