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

whisper-lastupdate: add utility #78

Closed

Conversation

@pabigot
Copy link

@pabigot pabigot commented May 15, 2014

This provides whisper with a capability similar to "rrdtool lastupdate": it returns the timestamp and value of the last metric added to the database. The utility can be used by a monitoring system to determine whether updates are still being received.

(I realize the search is potentially inefficient if, in fact, the database is not fairly current. However this implementation intentionally has minimal impact on the existing implementation. whisper would need some refactoring in both implementation and architecture to get something better.)

This returns the timestamp and value of the last metric added to the
database.  The utility can be used by a monitoring system to determine
whether updates are still being received.
@SEJeff
Copy link
Member

@SEJeff SEJeff commented Aug 30, 2014

@pabigot I'm going to write a test for this and provided it works, will merge it. That being said, graphite uses python 2.6 at a minimum, so using python's with statement is quite preferable to your:

try:
    fh = open(...)
finally:
    fh.close()

Looking at:

with open(...) as fh:
    do_stuff()

just is easier to look at and maintain.

@SEJeff
Copy link
Member

@SEJeff SEJeff commented Jun 17, 2015

Ping @pabigot, will you be willing to refactor this to use python best practices?

Also, perhaps it makes sense to simply modify whisper-fetch.py with a --lastupdate argument instead of adding an entirely new utility?

@pabigot
Copy link
Author

@pabigot pabigot commented Jun 17, 2015

@SEJeff Sorry, no. I haven't used whisper since shortly after I submitted this, so wouldn't be able to test that it still works after rebasing and refactoring. Feel free to refactor/reimplement/deal with it as you wish.

@deniszh
Copy link
Member

@deniszh deniszh commented Aug 2, 2016

Any objections to closing this?

@pabigot
Copy link
Author

@pabigot pabigot commented Aug 2, 2016

@deniszh no.

@pabigot pabigot closed this Aug 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants