question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Improvement] Add info on timespan and number ob objects to stats-api

See original GitHub issue

Hi,

I am just trying to connect an esp8266 to mycontroller to get the latest data of the current day:

http://raspi:8443/mc/rest/metrics/stats?sensorId=234&timestampFrom=1486141273860

This is working so far … I even found a nice json streaming library: https://github.com/squix78/json-streaming-parser

For an microcontroller with constrained memory etc. it would be really nice to know how many items are in the response and what timespan is covered. The current response is like this:

[ {
  "id" : 263,
  "internalId" : 234,
  "variableType" : "Humidity",
  "unit" : "%",
  "dataType" : "Double",
  "timeFormat" : "HH:mm:ss",
  "resourceName" : "[G]:mygateway >> [N]:31:MultiSensor >> [S]:0:Humidity >> [SV]:Humidity",
  "chartType" : "lineChart",
  "chartInterpolate" : "linear",
  "chartData" : [ {
    "key" : "Average",
    "values" : [ [ 1486144083769, 45.52727272727273 ], [ 1486144143769

I suggest adding from-timestamp, to-timestamp and number of items

[ { “id” : 263, “internalId” : 234, “variableType” : “Humidity”, “unit” : “%”, “dataType” : “Double”, “timeFormat” : “HH:mm:ss”, “resourceName” : “[G]:mygateway >> [N]:31:MultiSensor >> [S]:0:Humidity >> [SV]:Humidity”, “chartType” : “lineChart”, “chartInterpolate” : “linear”, “chartFromTS” : “1486144083769”, “chartToTS” : “1486230303769”, “chartDataItems” : 12345, “chartData” : [ { “key” : “Average”, “values” : [ [ 1486144083769, 45.52727272727273 ], [ 1486144143769

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
cimba007commented, Feb 7, 2017

@jkandasa: I am pretty happy with your latest implementation of duration. There is an pretty nice json-library which I use to parse the json returned by your api.

Just a sneak-preview of what I want to use it for:

Notice the little graph at the bottom, data fresh pulled from mycontroller … last 12hours in 30minute steps … it is pretty rough for now … no x-axis … but this will be my work for next weekend.

PS: Did you already add documentation for the “new” api? I think it is awesome and might help other fellow hackers out there a lot 😉

0reactions
Redfernecommented, Feb 12, 2017

Oh yes! Thanks for the details. I’m planning a similar project using a MoteinoMega (https://lowpowerlab.com/shop/product/138) I’m hoping that 128kbyte + 512kbyte flash is enough to hold all graphics.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Document for REST API · Issue #24 · mycontroller-org ... - GitHub
[Enhancement] Modify Sensors API Json response #124 ... [Improvement] Add info on timespan and number ob objects to stats-api #355.
Read more >
TimeSpan.Add(TimeSpan) Method (System) | Microsoft Learn
Returns a new TimeSpan object whose value is the sum of the specified TimeSpan object and this instance.
Read more >
Putting the TomTom Location History and Geofencing APIs to ...
The TomTom Location History API provides a one-stop service for tracking objects over time. Combined with the Geofencing API, you can create ...
Read more >
Manpage collectd.conf(5)
Path to the plugins (shared objects) of collectd. ... The dpdkstat plugin collects information about DPDK interfaces using the extended NIC stats API...
Read more >
Using Debug | Apigee X - Google Cloud
This section describes how to create and manage debug sessions, and view the request and response data using the Apigee UI and API....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found