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
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
4 participants
@pabigot
Copy link

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.)

whisper-lastupdate: add utility
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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

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?

@SEJeff SEJeff added the question label Jun 17, 2015

@pabigot

This comment has been minimized.

Copy link
Author

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.

@obfuscurity obfuscurity removed the question label Sep 13, 2015

@deniszh

This comment has been minimized.

Copy link
Member

deniszh commented Aug 2, 2016

Any objections to closing this?

@pabigot

This comment has been minimized.

Copy link
Author

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