public abstract class JsonWriter extends Object implements MetricsWriter
| Modifier and Type | Field and Description |
|---|---|
protected static Logger |
LOGGER |
protected MetricsService |
service |
| Constructor and Description |
|---|
JsonWriter(Writer writer) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addValueToJsonObject(javax.json.JsonObjectBuilder payloadBuilder,
String key,
Number value) |
protected abstract javax.json.JsonObjectBuilder |
getJsonData(String registryName) |
protected abstract javax.json.JsonObjectBuilder |
getJsonData(String registryName,
String metricName) |
protected javax.json.JsonObject |
getJsonFromMap(Map<String,Number> map,
String keySuffix) |
protected String |
getPairFromMap(Map<String,String> map) |
protected void |
serialize(javax.json.JsonObject payload) |
void |
write()
Write all the registered metrics
|
void |
write(String registryName)
Write the metrics that registered for the respective registryName.
|
void |
write(String registryName,
String metricName)
Write the metrics that matches the metricName for the respective registryName.
|
protected final MetricsService service
protected static final Logger LOGGER
public JsonWriter(Writer writer)
protected abstract javax.json.JsonObjectBuilder getJsonData(String registryName) throws NoSuchRegistryException
NoSuchRegistryExceptionprotected abstract javax.json.JsonObjectBuilder getJsonData(String registryName, String metricName) throws NoSuchRegistryException, NoSuchMetricException
public void write(String registryName, String metricName) throws NoSuchRegistryException, NoSuchMetricException, IOException
MetricsWriterwrite in interface MetricsWriterNoSuchRegistryExceptionNoSuchMetricExceptionIOExceptionpublic void write(String registryName) throws NoSuchRegistryException, IOException
MetricsWriterwrite in interface MetricsWriterNoSuchRegistryExceptionIOExceptionpublic void write()
throws IOException
MetricsWriterwrite in interface MetricsWriterIOExceptionprotected void serialize(javax.json.JsonObject payload)
throws IOException
IOExceptionprotected javax.json.JsonObject getJsonFromMap(Map<String,Number> map, String keySuffix)
protected void addValueToJsonObject(javax.json.JsonObjectBuilder payloadBuilder,
String key,
Number value)
Copyright © 2019. All rights reserved.