public static Task SendAsync(this IStatsd statsd, Func <Task> actionToTime, string statName, double sampleRate = 1) => statsd.SendAsync(actionToTime, statName.AsMemory(), sampleRate);
public static Task SendAsync <TCommandType>(this IStatsd statsd, string name, string value) where TCommandType : IAllowsString => statsd.SendAsync <TCommandType>(name.AsSpan(), value.AsSpan());
public static Task SendAsync <TCommandType>(this IStatsd statsd, string name, int value, double sampleRate) where TCommandType : IAllowsInteger, IAllowsSampleRate => statsd.SendAsync <TCommandType>(name.AsSpan(), value, sampleRate);
public static Task SendAsync <TCommandType>(this IStatsd statsd, string name, double value, bool isDeltaValue) where TCommandType : IAllowsDouble, IAllowsDelta => statsd.SendAsync <TCommandType>(name.AsSpan(), value, isDeltaValue);
public static Task SendAsync <TCommandType>(this IStatsd statsd, string name, int value) where TCommandType : IAllowsInteger => statsd.SendAsync <TCommandType>(name.AsSpan(), value);
/// <summary> /// Send a counter value. /// </summary> /// <param name="statName">Name of the metric.</param> /// <param name="value">Value of the counter. Defaults to 1.</param> /// <param name="sampleRate">Sample rate to reduce the load on your metric server. Defaults to 1 (100%).</param> public static Task CounterAsync(string statName, int value = 1, double sampleRate = 1) { return(_statsD.SendAsync <Statsd.Counting>(BuildNamespacedStatName(statName), value, sampleRate)); }