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) |
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
NoSuchRegistryException
protected abstract javax.json.JsonObjectBuilder getJsonData(String registryName, String metricName) throws NoSuchRegistryException, NoSuchMetricException
public void write(String registryName, String metricName) throws NoSuchRegistryException, NoSuchMetricException, IOException
MetricsWriter
write
in interface MetricsWriter
NoSuchRegistryException
NoSuchMetricException
IOException
public void write(String registryName) throws NoSuchRegistryException, IOException
MetricsWriter
write
in interface MetricsWriter
NoSuchRegistryException
IOException
public void write() throws IOException
MetricsWriter
write
in interface MetricsWriter
IOException
protected void serialize(javax.json.JsonObject payload) throws IOException
IOException
protected void addValueToJsonObject(javax.json.JsonObjectBuilder payloadBuilder, String key, Number value)
Copyright © 2018. All rights reserved.