Resolution of points returned in the chart API call

Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Locked
User avatar
koaiwi
 
Posts: 25
Joined: Thu Dec 28, 2017 10:11 am

Resolution of points returned in the chart API call

Post by koaiwi »

Hi

Question for clarification.

Assume data is posted every 5 minutes. Therefore 12 posts per hour.

If the chart API called for 2 hours of data at 1 minute interval resolution would the number of points returned be 24 or 120?

Thanks.

User avatar
koaiwi
 
Posts: 25
Joined: Thu Dec 28, 2017 10:11 am

Re: Resolution of points returned in the chart API call

Post by koaiwi »

Hi Adam

Any thoughts on this question. The reason I ask is that I am getting less points back than I would expect if the return was to take averages between posted points as it did with Xively.

Thanks.

User avatar
PaulRowntree
 
Posts: 391
Joined: Sun Apr 03, 2016 12:41 am

Re: Resolution of points returned in the chart API call

Post by PaulRowntree »

Sounds like the same issue raised here ... looks like the Chart averages data when refreshing historical information, then reports the correct number of points when doing real-time updates.

viewtopic.php?f=56&t=129787

User avatar
koaiwi
 
Posts: 25
Joined: Thu Dec 28, 2017 10:11 am

Re: Resolution of points returned in the chart API call

Post by koaiwi »

Hi Adam.

Still not getting an official response to the question. Is the forum the best place to get a response or should I try somewhere else.

Just for clarification for Paul - the observation is not on the chart graph interface but the api call for chart data which I then process. Just in case you thought it was the chart itself. But I think anyway you were just comparing the 2 problems and saying they were similar.

Thanks.

User avatar
PaulRowntree
 
Posts: 391
Joined: Sun Apr 03, 2016 12:41 am

Re: Resolution of points returned in the chart API call

Post by PaulRowntree »

I didn't realize there was a difference ... thanks. Still, I expect that the web dashboard uses a similar calling system to retrieve the mqtt data as the application.

User avatar
abachman
 
Posts: 352
Joined: Mon Feb 01, 2010 12:48 pm

Re: Resolution of points returned in the chart API call

Post by abachman »

hi koaiwi, Paul,


We do monitor these forums but aren't on call for every question, thanks for your patience.

The /charts API was built for our use on io.adafruit.com, basically, it always tries to fill the chart. So even though you're requesting a 1 minute resolution, if there's more data available at a higher resolution that fits inside the time span but doesn't overflow the chart (480 data points) then we serve that instead. So to the original question, we'd always return the 120.

It would be reasonable to let requests force a resolution, though, now that the API is seeing more use outside of just the IO user interface.


- adam

User avatar
koaiwi
 
Posts: 25
Joined: Thu Dec 28, 2017 10:11 am

Re: Resolution of points returned in the chart API call

Post by koaiwi »

Hi Adam

To your answer which sounds like an averaging thing. i.e. just to check - you are saying that if there were only 24 points in 2 hours then on a request for a 1 min resolution then there would be 120 points return. That's what my understanding is from you.

If so then this is not my experience. I'm going to do some more checking and get back to you if I still find I am getting less points than I would have expected.

Thanks.

User avatar
abachman
 
Posts: 352
Joined: Mon Feb 01, 2010 12:48 pm

Re: Resolution of points returned in the chart API call

Post by abachman »

Ah, sorry, I misread your original question. A feed with about one post every about five minutes is going to generate about 12 one minute aggregate values per hour. "About" because it depends on whether the last post hits at 00:59:59 or 01:00:01.

The /chart API should return 24 data points if you ask for the last 2 hours of that feed, but it won't actually be aggregating since the raw data doesn't overfill the chart. That's the "tries to fill the chart" bit.

I think there also may be something I'm missing in general. What API call did you make, what data did you receive, and what were you expecting?


- adam

User avatar
koaiwi
 
Posts: 25
Joined: Thu Dec 28, 2017 10:11 am

Re: Resolution of points returned in the chart API call

Post by koaiwi »

Hi Adam

I am using the chart api call to fill my own chart. I'll do some more testing on it and get back to you. I'm travelling for a while now so may take a few days once I have some conclusive data.

Thanks.

Locked
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.

Return to “Internet of Things: Adafruit IO and Wippersnapper”