public class CopperEggWriter extends AbstractOutputWriter implements OutputWriter
url": CopperEgg API server URL.
Optional, default value: "https://api.copperegg.com/v2/revealmetrics".user": CopperEgg user. Mandatorytoken": CopperEgg APIKEY. MandatorycoppereggApiTimeoutInMillis": read timeout of the calls to CopperEgg HTTP API.
Optional, default value: 20000.enabled": flag to enable/disable the writer. Optional, default value: true.source": CopperEgg . Optional, default value: "#hostname#" (the hostname of the server).| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_COPPEREGG_API_TIMEOUT_IN_MILLIS |
static String |
DEFAULT_COPPEREGG_API_URL |
static String |
DEFAULT_SOURCE |
static String |
METRIC_TYPE_COUNTER |
static String |
METRIC_TYPE_GAUGE |
static String |
SETTING_COPPEREGG_API_TIMEOUT_IN_MILLIS |
static String |
SETTING_SOURCE |
SETTING_HOST, SETTING_NAME_PREFIX, SETTING_PORT, SETTING_PROXY_HOST, SETTING_PROXY_PORT, SETTING_TOKEN, SETTING_URL, SETTING_USERNAME| Constructor and Description |
|---|
CopperEggWriter() |
| Modifier and Type | Method and Description |
|---|---|
String |
convertStreamToString(InputStream is) |
int |
cue_getExceptionCounter() |
void |
cue_serialize(Iterable<QueryResult> counters,
OutputStream out) |
void |
ensure_metric_groups()
If metric group doesn't exist, create it
If it does exist, update it.
|
String |
groupFind(String findName,
String findIndex,
Integer ExpectInt) |
void |
one_set(String mg_name,
List<QueryResult> counters) |
void |
read_config(InputStream in)
read_config()
The copperegg_config.json file contains a specification for the metric groups and dashboards to be created / or updated.
|
String |
Send_Commmand(String command,
String msgtype,
String payload,
Integer ExpectInt) |
void |
send_metrics(String mg_name,
List<QueryResult> counters) |
void |
sort_n_send(String mg_name,
List<QueryResult> mg_counters) |
void |
start()
Load settings
|
String |
write_tostring(com.fasterxml.jackson.databind.JsonNode json) |
void |
write(Iterable<QueryResult> results)
Export collected metrics to CopperEgg
|
equals, getBooleanSetting, getIntSetting, getIntSetting, getLongSetting, getSettings, getStrategy, getStringSetting, getStringSetting, hashCode, isEnabled, setEnabled, setSettings, setStrategy, stop, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetSettings, isEnabled, setEnabled, setSettings, stoppublic static final String METRIC_TYPE_GAUGE
public static final String METRIC_TYPE_COUNTER
public static final String DEFAULT_COPPEREGG_API_URL
public static final String SETTING_COPPEREGG_API_TIMEOUT_IN_MILLIS
public static final int DEFAULT_COPPEREGG_API_TIMEOUT_IN_MILLIS
public static final String SETTING_SOURCE
public static final String DEFAULT_SOURCE
public void start()
start in interface OutputWriterstart in class AbstractOutputWriterpublic void write(Iterable<QueryResult> results)
write in interface OutputWriterwrite in class AbstractOutputWriterpublic void sort_n_send(String mg_name, List<QueryResult> mg_counters)
public void send_metrics(String mg_name, List<QueryResult> counters)
public void one_set(String mg_name, List<QueryResult> counters)
public void cue_serialize(@Nonnull Iterable<QueryResult> counters, @Nonnull OutputStream out) throws IOException
IOExceptionpublic int cue_getExceptionCounter()
public void ensure_metric_groups()
public String convertStreamToString(InputStream is) throws IOException
IOExceptionpublic void read_config(InputStream in) throws Exception
Exceptionpublic String groupFind(String findName, String findIndex, Integer ExpectInt) throws Exception
Exceptionpublic String write_tostring(com.fasterxml.jackson.databind.JsonNode json)
Copyright © 2013. All Rights Reserved.