public interface Registry extends Serializable
| Modifier and Type | Field and Description |
|---|---|
static ConcurrentHashMap<String,Registry> |
REGISTRY_MAP |
| Modifier and Type | Method and Description |
|---|---|
void |
add(String name,
long value)
Add value to the metric.
|
void |
clear()
Clear all metrics.
|
default Map<String,Long> |
getAllCounts()
Get all Counter type metrics.
|
Map<String,Long> |
getAllCounts(boolean prefixWithRegistryName)
Get all Counter type metrics.
|
static Map<String,Long> |
getAllMetrics(boolean flush,
boolean prefixWithRegistryName)
Get all registered metrics.
|
static Registry |
getRegistry(String registryName)
Get (or create) the registry for a provided name.
|
static Registry |
getRegistry(String registryName,
String clazz)
Get (or create) the registry for a provided name and given class.
|
void |
increment(String name)
Increment the metric.
|
void |
set(String name,
long value)
Set the value to the metric.
|
static final ConcurrentHashMap<String,Registry> REGISTRY_MAP
static Registry getRegistry(String registryName)
LocalRegistry.registryName - Name of the registrystatic Registry getRegistry(String registryName, String clazz)
registryName - Name of the registry.clazz - The fully qualified name of the registry class to create.static Map<String,Long> getAllMetrics(boolean flush, boolean prefixWithRegistryName)
flush - clear all metrics after this operation.prefixWithRegistryName - prefix each metric name with the registry name.void clear()
void increment(String name)
name - Name of the metric to increment.void add(String name, long value)
name - Name of the metric.value - The value to add to the metrics.void set(String name, long value)
name - Name of the metric.value - The value to set for the metrics.Copyright © 2024 The Apache Software Foundation. All rights reserved.