statsd-csharp-client
statsd-csharp-client copied to clipboard
Support for gauge offset and potential bug with raw metric
Currently, it looks like there is no option to send offset to gauge, only absolute value. This is supported by statsd with +x, -x notation when number is specified.
BTW, statsd reports the following error when sending raw format:
DEBUG: Bad line: 982,r,1380635905 in msg "test.already.aggregated:982|r|1380635905"
The code used is:
TimeSpan t = DateTime.UtcNow - new DateTime(1970, 1, 1); int secondsSinceEpoch = (int)t.TotalSeconds; statsd.LogRaw("test.already.aggregated", 982, secondsSinceEpoch);
It works when I use null instead secondsSinceEpoch
Thanks for the report! I'll take a look in the next few days and feed back.
Sent from my iPhone
On 01 Oct 2013, at 4:02 PM, Miodrag Milic [email protected] wrote:
Currently, it looks like there is no option to send offset to gauge, only absolute value. This is supported by statsd with +x, -x notation when number is specified.
BTW, statsd reports the following error when sending raw format:
DEBUG: Bad line: 982,r,1380635905 in msg "test.already.aggregated:982|r|1380635905" The code used is:
TimeSpan t = DateTime.UtcNow - new DateTime(1970, 1, 1); int secondsSinceEpoch = (int)t.TotalSeconds; statsd.LogRaw("test.already.aggregated", 982, secondsSinceEpoch); It works when I use null instead secondsSinceEpoch
— Reply to this email directly or view it on GitHub.
Reworking the sending of gauge values to allow +x and -x will take me some time.
If you use LogRaw without passing in the epoch then it should work. Adding the epoch is allowed when sending metrics to statsd.net, but not statsd.
Hi Luke,
Any progress on incrementing / decrementing gauges?
I needed this functionality so implemented it in my fork by adding two new methods to IStatsd:
-
IncrementGague(name, value)
-
DecrementGauge(name, value)
If you are interested I can send you pull request to integrate it with main repository.
Thanks, Mariusz
@mariuszwojcik If you want to get latest and send a pull request with tests I'll accept it.
Also, why do we need those methods? We could just inspect the value and provide the right call.
@mariuszwojcik, When you get some time, please send a pull request and we'll get this into the library.
Hey guys — what's the status of this issue? I'm in need of a Gauge with Delta values but didn't want to submit a PR if someone's already working on it . . . thanks!
@josheinhorn can you submit a pr for this.
Can you submit a pr for this?