Created
October 19, 2011 16:50
-
-
Save clofresh/1298904 to your computer and use it in GitHub Desktop.
Sample metrics objects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
metrics = MetricFamily('my_app') | |
results = do_work() | |
metrics.record('result.created', len(results)) # my_app.result.created | |
for result in results: | |
result.save() | |
# my_app.result.saved. Each time increment is called, either increment the value at that timestamp (truncated | |
# to the second) or create a new point and increment that value. | |
metrics.increment('result.saved') | |
metrics.submit() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment