Data Viewer questions

Yes, if your feed interval is 5s (minimum allowed in the dropdown when creating a feed) or anything higher, and in your API call you set “interval” to anything lower than that (like you say 1s) and “limit_interval” to 1, then you will get all the datapoints (at the feed’s interval), there will be not any “empty” datapoints. If you Limitinterval = 0 you wilt get datapoints with a null value because there is no data for them.

This need a bit of explanation, so how fixed interval feeds work:

  • For each feed we have file storing metadata (feed_id.meta), it keeps the timestamp of when the feed was created and the interval.
  • The values are stored in another file (feed_id.dat)
    • Each byte in the file is a feed value
    • Let say the interval is 1m, then the 1st byte of the file has the value of the first sample (creation date), the 2nd byte has the value of the sample 1 minute later, 3rd byte the value of sample 3 which is 2 minutes after creation… and so on
  • Imagine the following situation:
    • when the 10 first samples have arrived, our file is 10 bytes long and the file has data for those first 10 minutes
    • for some reason the next 10 samples get lost, so aren’t ingested by emonCMS. We have lost 10 minutes of data and nothing has been written to the file
    • The next sample arrives. This is minute 21, but in our file we still only have the first 10 samples
    • Because emonCMS knows the starting date of the file, it calculates this new sample has to be stored in byte 21.
    • emonCMS opens the file and realizes that its only 10 bytes long. So what it does is insert 10 null values for the missing samples and stores sample 21.

And now, to answer your question, when you request the data via API with skipmissing = 0, you get something like:

[[timestamp_1,5],[timestamp_2,7],[timestamp_3,null],[timestamp_4,6]]

As you see, the 3rd sample got lost and its value is null.

If you request the data via API with skipmissing = 1, you would get something like:

[[timestamp_1,5],[timestamp_2,7],[timestamp_4,6]]

Effectively you have skipped the missing value.

1 Like