Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request to add ts.add latest sample event #1580

Open
vzambo64 opened this issue Feb 27, 2024 · 0 comments
Open

Request to add ts.add latest sample event #1580

vzambo64 opened this issue Feb 27, 2024 · 0 comments

Comments

@vzambo64
Copy link

Time-series module emits "ts.add:dest" event when the latest bucket is closed and a new bucket is opened in a destination rule compacted time-series.
No event is emitted if data is received and compacted to the latest bucket until the bucket is closed, so this event has a latency at least of the bucket time after the time-series latest value is changed.
The LATEST flag allows to include the actual value of the latest bucket in the requesting commands. When the task is to process the actual value of a destination rule time-series there is no event to listen for the latest bucket changes.
Suggesting to add a ts.add:dest:latest event by inserting the following lines into the module.c as the last statement in the handleCompaction function:
RedisModule_NotifyKeyspaceEvent( ctx, REDISMODULE_NOTIFY_MODULE,"ts.add:dest:latest", rule->destKey);
This is emitting the event message when a sample is added from a source as the highest timestamp sample into the destination time-series. The subscriber receiving the event can get and process the latest value of the time-series.
If the event notification results in a significant performance drop a configuration argument might be added to conditionally turn on this event notification.
(I have a branch for it in a fork...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant