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

[email protected]:~ $ od -i /var/lib/phpfina/100458.meta
0000000           0           0        3600  1483228800
[email protected]:~ $

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?


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?





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?