public class Metrics extends Object
| 构造器和说明 |
|---|
Metrics() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
counter(String key,
long value,
String... tagKvs)
description: Store tagKvs should be formatted as "key:value"
example: counter("request.count", 1, "method:user", "type:upload")
|
static void |
latency(String key,
long begin,
String... tagKvs) |
static void |
meter(String key,
long value,
String... tagKvs)
description:
- meter(xx) = counter(xx) + rateCounter(xx.rate)
- Store tagKvs should be formatted as "key:value"
example: rateCounter("request.count", 1, "method:user", "type:upload")
|
static void |
rateCounter(String key,
long value,
String... tagKvs)
description: Store tagKvs should be formatted as "key:value"
example: rateCounter("request.count", 1, "method:user", "type:upload")
|
static void |
store(String key,
long value,
String... tagKvs)
description: Store tagKvs should be formatted as "key:value"
example: store("goroutine.count", 400, "ip:127.0.0.1")
|
static void |
timer(String key,
long value,
String... tagKvs) |
public static void store(String key, long value, String... tagKvs)
public static void counter(String key, long value, String... tagKvs)
public static void timer(String key, long value, String... tagKvs)
value - :The unit of `value` is milliseconds
example: timer("request.cost", 100, "method:user", "type:upload")
description: Store tagKvs should be formatted as "key:value"public static void latency(String key, long begin, String... tagKvs)
begin - :The unit of `begin` is milliseconds
example: latency("request.latency", startTime, "method:user", "type:upload")
description: Store tagKvs should be formatted as "key:value"public static void rateCounter(String key, long value, String... tagKvs)
Copyright © 2023. All rights reserved.