REST Wiki documentation updates (timestamp and metric/name)

Description

It seems that at some point "metric" got changed to be called "name" or vice versa. It was still listed as metric in the wiki, but in current released code name is the only field that works for POST to sample, and it's what is returned from a GET from sample.

I'm not sure about other cases like search and measure so I didn't change the documentation there.

I also noticed inconsistencies with regards to timestamp. The input seems to need microseconds instead of milliseconds, although in truth it seems to accept any positive integer (then fail silently if they're too low 1417 as an example.... this may be getting too tangential and need another bug report)

Anyway, it seems to silently reject millisecond timestamps and likes microsecond timestamps, so the documentation probably should say to use those if that is what is intended (but I wasn't sure because I don't know what would be returned in some cases either.. I'm not sure if it's normalizing internally or just storing what is sent)

Lucidchart Diagrams

Activity

Seth Leger February 29, 2016 at 3:13 PM

It sounds like everything is working as expected here, resolving issue.

Robert Drake July 22, 2015 at 9:07 PM

I'm a total idiot.

The documentation is right. It's milliseconds and seconds, not microseconds.

It's confusing that the time is input in different formats in different places, but the documentation is consistent and correct.

I'll leave this open for a few days to let people read some of it. In particular, I want to know if the metrics -> name change is correct or if I should revert the wiki. Otherwise this can be closed.

Robert Drake July 22, 2015 at 8:11 AM

After testing further, I found that GET actually does need milliseconds, as documented.

Example:

curl "http://localhost:8080/samples/bb1-56-mar?start=13&end=1437539710001"
{"code":400,"message":"Unable to parse '1437539710001' as date-time"}

curl "http://localhost:8080/samples/bb1-56-mar?start=13&end=1437539710"
[[{"name":"temperature3","timestamp":1437517776,"type":"GAUGE","value":33.0},{"name":"temperature","timestamp":1437517776,"type":"GAUGE","value":33.0}],[{"name":"temperature2","timestamp":1437517776000,"type":"GAUGE","value":33.0},{"name":"temperature","timestamp":1437517776000,"type":"GAUGE","value":33.0}],[{"name":"temperature4","timestamp":1437539710000,"type":"COUNTER","value":373}]]

Cannot Reproduce

Details

Assignee

Reporter

Components

Affects versions

Priority

PagerDuty

Created July 21, 2015 at 7:03 PM
Updated February 29, 2016 at 3:13 PM
Resolved February 29, 2016 at 3:13 PM