Why does POST /api/v1/metrics/total return 2x the value compared to the Web UI?

Question from a user at Telstra on Twitter: https://twitter.com/_TimMcMahon/status/892273667157016576

E.g. Compare Network - Packets In for a device group for the last 6 hours with an API call for a 5min cycle in the past 5 minutes.

{
  "metric_category":"net",
  "from":-300000,
  "object_type":"device_group",
  "object_ids":[9],
  "metric_specs":[{"name":"pkts_in"}],
  "until":0,
  "cycle":"5min"
}

The answer: “from”:-299999

Resolved on Twitter: https://twitter.com/_TimMcMahon/status/892533209463795712

Thanks!

The “from” and “until” seem to be inclusive, so a period of 300000 ends up returning two 5min stat points.

Walker suggested 299999 and that did the trick.

P.S. I think my password broke a login script on extrahop.com (500 internal server error) but I managed to get in and post this :smiley: