/// <inheritdoc /> public void Increment(string @event, string tags, int value = 1) { _statsDPublisher.Increment(value, $"{@event},{tags},{_mandatoryTags}"); }
/// <summary> /// Publishes a counter decrement for the specified bucket and value. /// </summary> /// <param name="publisher">The <see cref="IStatsDPublisher"/> to publish with.</param> /// <param name="value">The value to decrement the counter by.</param> /// <param name="bucket">The bucket to decrement the counter for.</param> public static void Decrement(this IStatsDPublisher publisher, long value, string bucket) { publisher.Increment(value > 0 ? -value : value, DefaultSampleRate, bucket); }
/// <summary> /// Publishes a counter decrement for the specified bucket and value. /// </summary> /// <param name="publisher">The <see cref="IStatsDPublisher"/> to publish with.</param> /// <param name="value">The value to decrement the counter by.</param> /// <param name="bucket">The bucket to decrement the counter for.</param> /// <param name="tags">An optional dictionary of tags.</param> public static void Decrement(this IStatsDPublisher publisher, long value, string bucket, IDictionary <string, string>?tags = null) { publisher.Increment(value > 0 ? -value : value, DefaultSampleRate, bucket, tags); }
/// <summary> /// Publishes a counter for the specified bucket with a value of minus one (-1). /// </summary> /// <param name="publisher">The <see cref="IStatsDPublisher"/> to publish with.</param> /// <param name="bucket">The bucket to decrement the counter for.</param> public static void Decrement(this IStatsDPublisher publisher, string bucket) { publisher.Increment(-1, DefaultSampleRate, bucket); }
/// <summary> /// Publishes a counter for the specified bucket with a value of one (1). /// </summary> /// <param name="publisher">The <see cref="IStatsDPublisher"/> to publish with.</param> /// <param name="bucket">The bucket to increment the counter for.</param> /// <param name="tags">An optional dictionary of tags.</param> public static void Increment(this IStatsDPublisher publisher, string bucket, IDictionary <string, string>?tags = null) { publisher.Increment(1, DefaultSampleRate, bucket, tags); }