-
Notifications
You must be signed in to change notification settings - Fork 216
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
Refresh successful after metrics updated #522
base: master
Are you sure you want to change the base?
Refresh successful after metrics updated #522
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me.
Edit : We might have to consider a workaround to solve your issue instead of going forward with these changes.
It would not be safe to mark consumer initial load as completed before the refresh listeners are executed (i.e all indices are initialized) as the consumer will start accepting requests sooner than it should and will give erroneous results. Will update here with a workaround.
@nayanika-u, thanks for the comment. Is that true for the metric collectors as well? Would pushing event emitting loop (lines 183-185) above initialLoad.complete(getCurrentVersionId()); but below metrics.updateTypeStateMetrics(getStateEngine(), requestedVersion);
if(metricsCollector != null)
metricsCollector.collect(metrics); do the trick? |
@yonatang your proposed tweak sounds good to me [EDIT: I take my above approval back, thanks Nayanika for pointing out to me that if a refresh listener throws an exception then we would have already logged the success metric at that point, derp.] |
Upon a closer look, @yonatang it might not be a good idea to log those metrics using a Have you considered specifying a metrics collector on the consumer? That seems to solve your problem of not seeing the latest metrics through a refresh listener. |
@Sunjeet AFAIK metric collector can be specified during creation only. Since I'm thinking about kind of a middleware, I'd like to instrument existing consumers that were created externally (think about consumers that were created by |
Right now, if someone will try to log the latest metrics using
RefreshListener
, they will get wrong results, because the event is emitted before the metrics are updated. If this is the first refresh, it will show 0 entities and 0 kb used.This is particularly annoying when trying to build a tool around Hollow that will integrate with existing corporate monitoring systems.