These are the API calls for storing and retrieving data samples to/from Uptime Cloud Monitor Custom Metrics.
To store a data sample, you POST the new value, referencing it using the metric name, metric group, and identifier.
None
curl -su <APIKEY>:U -H "Content-type: application/json" -XPOST https://api.copperegg.com/v2/revealmetrics/samples/<METRICGROUP_ID>.json -d '{"identifier": <YOURIDENTIFIER>,"timestamp": <UNIXTIMESTAMP>, "values": { <METRICNAME>: <METRICVALUE>}'
Response is Status 200 and a null response is returned.
{
"values": {
"System_File_Write_Operations_per_sec": 79.43018242417115,
"System_File_Control_Operations_per_sec": 180.70366501498935,
"System_Context_Switches_per_sec": 861.817479302257,
"System_System_Calls_per_sec": 10713.145854460083,
"System_Processor_Queue_Length": 0,
"System_Processes": 64,
"System_Exception_Dispatches_per_sec": 91.344709787796816,
"System_File_Read_Operations_per_sec": 131.05980099988238,
"Paging_File_total_Percent_Usage_Peak": 9.2311083323008827,
"System_System_Up_Time": 7398.4709609,
"Paging_File_total_Percent_Usage": 9.05506366132578,
"System_Threads": 754
},
"timestamp": 1357760740,
"identifier": "WIN-1M8N94S69C8" # this identifier is a server hostname
}
NOTE: This API Request is deprecated.
curl -su <APIKEY>:U -XGET "https://api.copperegg.com/v2/revealmetrics/samples.json" -H "Content-Type: application/json" -d '{"queries":{"<METRIC_GROUP_ID>":[{"metrics":["<METRIC_NAME>"]}]}}'
A Hash containing the requested data.
{
"_ts":1354126050, # unix timestamp indicating the first sample of this series (offset == 0)
"values":{ # a hash of all metrics returned
"scottsmetrics_v2":[ # metric group id
{
"mymac":{ # server/probe identifier
"0":[1354126055]," # offset from starttime : data sample at that time
15":[1354126070],
"30":[1354126087],
"45":[1354126102],
"60":[1354126118],
"75":[1354126134],
"90":[1354126150],
"105":[1354126166],
"120":[1354126181],
"135":[1354126197],
"150":[1354126214],
"180":[1354126232],
"195":[1354126248],
"210":[1354126263],
"225":[1354126279],
"240":[1354126295],
"255":[1354126311],
"270":[1354126327],
"285":[1354126343]
}
}
]
}
}