public class MetricsHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
OPERATION_DIMENSION_NAME |
static String |
SHARD_ID_DIMENSION_NAME |
static String |
SUCCESS |
static String |
TIME |
Constructor and Description |
---|
MetricsHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
addLatency(long startTimeMillis,
MetricsLevel level) |
static void |
addLatency(String prefix,
long startTimeMillis,
MetricsLevel level) |
static void |
addLatencyPerShard(String shardId,
String prefix,
long startTimeMillis,
MetricsLevel level) |
static void |
addSuccessAndLatency(long startTimeMillis,
boolean success,
MetricsLevel level) |
static void |
addSuccessAndLatency(String prefix,
long startTimeMillis,
boolean success,
MetricsLevel level) |
static void |
addSuccessAndLatencyPerShard(String shardId,
String prefix,
long startTimeMillis,
boolean success,
MetricsLevel level) |
static void |
endScope() |
static IMetricsScope |
getMetricsScope() |
static void |
setMetricsScope(IMetricsScope scope)
Sets given metrics scope for the current thread.
|
static IMetricsScope |
startScope(IMetricsFactory factory) |
static IMetricsScope |
startScope(IMetricsFactory factory,
String operation) |
static void |
unsetMetricsScope()
Unsets the metrics scope for the current thread.
|
public static final String OPERATION_DIMENSION_NAME
public static final String SHARD_ID_DIMENSION_NAME
public static final String TIME
public static final String SUCCESS
public static IMetricsScope startScope(IMetricsFactory factory)
public static IMetricsScope startScope(IMetricsFactory factory, String operation)
public static void setMetricsScope(IMetricsScope scope)
scope
- public static void unsetMetricsScope()
public static IMetricsScope getMetricsScope()
public static void addSuccessAndLatency(long startTimeMillis, boolean success, MetricsLevel level)
public static void addSuccessAndLatency(String prefix, long startTimeMillis, boolean success, MetricsLevel level)
public static void addSuccessAndLatencyPerShard(String shardId, String prefix, long startTimeMillis, boolean success, MetricsLevel level)
public static void addLatency(long startTimeMillis, MetricsLevel level)
public static void addLatency(String prefix, long startTimeMillis, MetricsLevel level)
public static void addLatencyPerShard(String shardId, String prefix, long startTimeMillis, MetricsLevel level)
public static void endScope()
Copyright © 2017. All rights reserved.