예제 #1
0
 public static Task SendAsync(this IStatsd statsd, Func <Task> actionToTime, string statName, double sampleRate = 1) =>
 statsd.SendAsync(actionToTime, statName.AsMemory(), sampleRate);
예제 #2
0
 public static Task SendAsync <TCommandType>(this IStatsd statsd, string name, string value) where TCommandType : IAllowsString =>
 statsd.SendAsync <TCommandType>(name.AsSpan(), value.AsSpan());
예제 #3
0
 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);
예제 #4
0
 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);
예제 #5
0
 public static Task SendAsync <TCommandType>(this IStatsd statsd, string name, int value) where TCommandType : IAllowsInteger =>
 statsd.SendAsync <TCommandType>(name.AsSpan(), value);
예제 #6
0
 /// <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));
 }