Merge lp://staging/~lucio.torre/txstatsd/webserver-for-extra-data into lp://staging/txstatsd

Proposed by Lucio Torre
Status: Merged
Approved by: Lucio Torre
Approved revision: 73
Merged at revision: 72
Proposed branch: lp://staging/~lucio.torre/txstatsd/webserver-for-extra-data
Merge into: lp://staging/txstatsd
Diff against target: 474 lines (+278/-14)
10 files modified
txstatsd/metrics/histogrammetric.py (+30/-1)
txstatsd/metrics/timermetric.py (+22/-0)
txstatsd/server/configurableprocessor.py (+1/-9)
txstatsd/server/httpinfo.py (+60/-0)
txstatsd/server/processor.py (+11/-1)
txstatsd/service.py (+8/-1)
txstatsd/tests/metrics/test_histogrammetric.py (+15/-0)
txstatsd/tests/stats/test_exponentiallydecayingsample.py (+1/-1)
txstatsd/tests/test_httpinfo.py (+128/-0)
txstatsd/tests/test_service.py (+2/-1)
To merge this branch: bzr merge lp://staging/~lucio.torre/txstatsd/webserver-for-extra-data
Reviewer Review Type Date Requested Status
Sidnei da Silva Approve
Review via email: mp+91921@code.staging.launchpad.net

Commit message

add a webserver for nagios and extra data not in time series format

Description of the change

$ PYTHONPATH=. twistd statsd -c sample.conf

$ telnet localhost 11111
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
foo.metric:100|ms
foo.metric:110|ms
^]q

telnet> q
Connection closed.
$ curl http://localhost:12312/metrics/foo.metric
[0.0, 2.0]

A nice histogram!
Also add /status that checks that process time and flush time are 0.7x of flush_interval

To post a comment you must log in.
Revision history for this message
Sidnei da Silva (sidnei) wrote :

Please make the /status resource return pure json, without the OK/ERROR. Or even encode that in the json with {'status': 'OK'} or {'status':'ERROR'}. Alternatively, OK == HTTP Status 200, Error == HTTP Status 500.

It's probably a good idea to return the histogram under a json structure instead of as a plain list, that way it's easier to extend it in the future to return more info if needed without breaking existing parsing. Eg: {'histogram': [..values..]}.

review: Needs Fixing
Revision history for this message
Lucio Torre (lucio.torre) wrote :

addressed those requests

72. By Lucio Torre

500 on status error, histogram fixed.

Revision history for this message
Sidnei da Silva (sidnei) wrote :

self.fail("Not 404") should be self.fail("Not 500")

Other than that, looks good.

review: Approve
73. By Lucio Torre

not 404, 500

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches