Log to Feed interval

Is it possible to see what the interval is for an existing Log to Feed feed. It see a similar question was asked here. It would be useful to be able to see this information. I want to create a second feed that is the same as another created a while ago but I cannot remember what the interval was.

Try od -i /path/to/phpfina/123.meta

pi@emoncmsPi:~ $ od -i /var/lib/phpfina/100458.meta
0000000           0           0        3600  1483228800
0000020
pi@emoncmsPi:~ $

3600 is the interval
1483228800 is the start time

from Display RAW feed data from PHP engines for debuging

OK thanks. Could this information be included in the interface?

1 Like

I too think this would be a useful addition, perhaps raising a feature request “issue” on github would help?

EDIT - I have opened an issue, feel free to add or expand on it…

1 Like

You can use the undocumented API: https://emoncms.org/feed/getmeta.json?id=1
Result for PHPFINA feed is: {“interval”:10,“start_time”:1461310000,“npoints”:65748}

1 Like

Good find!!!

Just tried it on a self-hosted emoncms v9.7.8 PHPfina and got slightly different results though, not sure why?

{“interval”:10,“start_time”:1474373280}

Thanks for sharing that.

Works on 9.2 as well (yes I know still not been brave enough to upgrade…)

I do wish the API was properly documented; not that I’ve mentioned it before {GRD}

Seems like the npints is returned only after the feed file is accessed via read/write. When you just start the server and get meta, only the start time and interval are available.

I’m not sure I understand what you mean there, I ran the same API url as you quoted on a live system, the phpfina feed I tested against is fully initialized and currently logged to.

If you get data from the feed using /feed/data.json?.. and then call the /feed/getmeta.json?.. you should get the npoints as well (based on the code, I didn’t test it myself on a local instance).

Do you mean like this?

https://myserver/feed/data.json?id=100240&start=1481064538000&end=1481064738000&interval=10

[[1481064548000,45.25],[1481064558000,45.369998931885],[1481064568000,44.944999694824],[1481064578000,45.549999237061],[1481064588000,45.055000305176],[1481064598000,45.650001525879],[1481064608000,45.979999542236],[1481064618000,45.104999542236],[1481064628000,47.185001373291],[1481064638000,46.604999542236],[1481064648000,47.990001678467],[1481064658000,47.439998626709],[1481064668000,45.509998321533],[1481064678000,46.485000610352],[1481064688000,46.599998474121],[1481064698000,46.944999694824],[1481064708000,45.310001373291],[1481064718000,45.900001525879],[1481064728000,43.604999542236],[1481064738000,46.764999389648],[1481064748000,43.229999542236]]

https://myserver/feed/getmeta.json?id=100240

{“interval”:5,“start_time”:1467633890}

Looking at the code it appears the npoints has been added to emoncms.org but not the main emoncms repo, although the api and the feed functions do the same job, the PHPfina feed engine and the fields it returns from get_data() are different.

My mistake.
I was unaware there is a different codebase for emoncmsorg and I was testing the API against emoncms.org.
I was also mistaken the static $metadata_cache to be persistent across multiple requests, and this is not the case in PHP.

I wouldn’t say that as I would not of expected these differences even though I was aware there was a separate repo. Thanks for pointing out the api, either does the job, I just didn’t understand the difference in results. Perhaps we could add the npoints to the main repo if it is useful?