cdwdirect/sos_flow

Add the ability to cache most recent frame in memory

Closed this issue · 1 comments

khuck commented

Currently, analysis scripts that are live-streaming need to query the DB to get the most recent frame. The most recent frame(s) of data (for all tbldata values) needs to be stored in a cache.

  • the number of frames should be configurable

Done. Reminder that attaching to an existing database does not retroactively populate the cache, only newly published values will be retained in the cache.

//Configure daemon to store 10 frames for this pub.
SOS_pub_config(pub, SOS_PUB_OPTION_CACHE, 10);

//Query the local SOS cache for all pub titles, all value names, latest frame, one deep:
SOSA_cache_grab(SOS, "", "", -1 1, "localhost", 22500); //Query all pubs & values for latest single frame.

Default cache depth is set in sos_options.c Cache is always enabled, but defaults to zero depth.