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

Flush timestamps are not aligned #206

Open
luca3m opened this issue Jul 18, 2016 · 5 comments
Open

Flush timestamps are not aligned #206

luca3m opened this issue Jul 18, 2016 · 5 comments

Comments

@luca3m
Copy link
Contributor

luca3m commented Jul 18, 2016

When configuring statsite with a flush time of 10s I noticed that the flush timestamp it's not aligned.

I get these results (the result depends on the timestamp of statsite launch):

counts.test|4.000000|1468836448
counts.test|4.000000|1468836458
counts.test|4.000000|1468836468

And not

counts.test|4.000000|1468836440
counts.test|4.000000|1468836450
counts.test|4.000000|1468836460

Would be better the latter, wouldn't it?

@luca3m
Copy link
Contributor Author

luca3m commented Jul 19, 2016

I've been able to make it work using ev_periodic instead of ev_timer, see manpage. I think it's important for a tool like this to use absolute timer instead of relative ones.

Looks like ae has not a native support for this kind of events, statsite should calculate by itself the drift between two flush events.

@armon
Copy link
Collaborator

armon commented Jul 20, 2016

@luca3m Do you mean ae is causing drift? Or that it is just not aligned with the 10 second interval?

@luca3m
Copy link
Contributor Author

luca3m commented Jul 20, 2016

The latter. It has never been aligned. With libev is easier to implement it, on ae it's not. If you are interested on merging this I can try to provide a patch implemented with ae.

@luca3m luca3m changed the title Flust timestamp are not aligned Flush timestamp are not aligned Jul 20, 2016
@luca3m luca3m changed the title Flush timestamp are not aligned Flush timestamps are not aligned Jul 20, 2016
@armon
Copy link
Collaborator

armon commented Jul 20, 2016

@luca3m Yeah, I think this should be configurable behavior, but it would be nice to have an strict alignment mode!

@ghost
Copy link

ghost commented Oct 17, 2016

One other feature idea to perhaps tack on with the strict alignment mode would be a random offset between the end of the flush interval and when the data is dumped to the sink. If you're using a sink that then forwards to a third-party logging service it's not necessarily desirable to have all clients pushing at exactly the same time. Granted, this could be added in to the sink itself, but might be better off as a universal feature.

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

2 participants