librato-rack
librato-rack copied to clipboard
Flushing at exit
I'm switching from using statsd to using this gem, and I was surprised to not be able to find any code which is ensuring a final flush is performed before the process exits. Is there a reason for this? It obviously means that when a server is restarted then there will be up to flush_interval
of data loss.
I was able to achieve the final flush via:
at_exit { Librato.tracker.flush }
Perhaps this isn't included by default for some reason I haven't thought of. Is there any reason not to do this?
Thanks
@jonleighton - apologies for the delayed response. This is a great point. Originally I think we had some reservations about some possible negative aspects of an at_exit
force flush but at this point I think adding it would make a lot of sense.
we'll do a little digging and look into adding this.