public override bool TryBinaryOperation(BinaryOperationBinder binder, object arg, out object result) { if (binder.Operation == ExpressionType.AddAssign) { var quantity = (int)arg; var name = String.Join(".", _parts); switch (_metricType) { case MetricType.COUNT: _statsd.LogCount(name, quantity); break; case MetricType.GAUGE: _statsd.LogGauge(name, quantity); break; case MetricType.TIMING: _statsd.LogTiming(name, quantity); break; case MetricType.SET: _statsd.LogSet(name, quantity); break; } result = null; return(true); } result = null; return(false); }
private static void IntHandler(IStatsd client, string metricType, string name, object arg) { var value = Convert.ToInt32(arg); switch (metricType) { case MetricType.COUNT: client.LogCount(name, value); break; case MetricType.GAUGE: client.LogGauge(name, value); break; case MetricType.TIMING: client.LogTiming(name, value); break; case MetricType.SET: client.LogSet(name, value); break; } }
public void Counter(string statName, int value = 1) { _client.LogCount(statName, value); }
public void LogCount(string name, int count, Dictionary <string, string> tags = null) { RunSafe( () => _statsd.LogCount(BuildName(name, tags), count)); }
public void LogCount(string name, int count = 1) { _statsdClient.LogCount(string.Format("{0}.{1}", GetStandardPrefix, name), count); }