|
4 | 4 |
|
5 | 5 |
|
6 | 6 | class Gauge(statsd.Client): |
7 | | - '''Class to implement a statsd gauge |
8 | 7 |
|
9 | | - ''' |
| 8 | + 'Class to implement a statsd gauge' |
10 | 9 |
|
11 | 10 | def _send(self, subname, value): |
12 | 11 | '''Send the data to statsd via self.connection |
@@ -98,20 +97,22 @@ def __sub__(self, delta): |
98 | 97 | return self |
99 | 98 |
|
100 | 99 | def set(self, subname, value): |
101 | | - '''Set the data ignoring the sign, ie set("test", -1) will |
102 | | - set "test" exactly to -1 (not decrement it by 1) |
103 | | - |
104 | | - See |
105 | | - https://github.com/etsy/statsd/blob/master/docs/metric_types.md |
| 100 | + ''' |
| 101 | + Set the data ignoring the sign, ie set("test", -1) will set "test" |
| 102 | + exactly to -1 (not decrement it by 1) |
| 103 | +
|
| 104 | + See https://github.com/etsy/statsd/blob/master/docs/metric_types.md |
106 | 105 | "Adding a sign to the gauge value will change the value, rather |
107 | | - than setting it. |
108 | | - gaugor:-10|g |
109 | | - gaugor:+4|g |
110 | | - So if gaugor was 333, those commands would set it to 333 - 10 + 4, |
111 | | - or 327. |
112 | | - Note: |
113 | | - This implies you can't explicitly set a gauge to a negative number |
114 | | - without first setting it to zero." |
| 106 | + than setting it. |
| 107 | +
|
| 108 | + gaugor:-10|g |
| 109 | + gaugor:+4|g |
| 110 | +
|
| 111 | + So if gaugor was 333, those commands would set it to 333 - 10 + 4, or |
| 112 | + 327. |
| 113 | +
|
| 114 | + Note: This implies you can't explicitly set a gauge to a negative |
| 115 | + number without first setting it to zero." |
115 | 116 |
|
116 | 117 | :keyword subname: The subname to report the data to (appended to the |
117 | 118 | client name) |
|
0 commit comments