Increment() публичный Метод

public Increment ( long magnitude ) : string
magnitude long
Результат string
Пример #1
0
        public void IncrementingCounterWithValueIsCorrect()
        {
            // Arrange
            var target = new StatsDMessageFormatter();

            // Act
            string actual = target.Increment(_value, _statBucket);

            // Assert
            actual.ShouldBe(string.Format(CultureInfo.InvariantCulture, "{0}:{1}|c", _statBucket, _value));
        }
Пример #2
0
        public void IncrementingCounterIsCorrect()
        {
            // Arrange
            var target = new StatsDMessageFormatter(_culture);

            // Act
            string actual = target.Increment(_statBucket);

            // Assert
            actual.ShouldBe(string.Format(_culture, "{0}:{1}|c", _statBucket, 1));
        }
Пример #3
0
        public void ValuesArePrefixed()
        {
            var prefix = "foo";
            var target = new StatsDMessageFormatter(prefix);

            var actualGauge     = target.Gauge(_value, _statBucket);
            var actualDecrement = target.Decrement(_statBucket);
            var actualIncrement = target.Increment(_statBucket);
            var actualTiming    = target.Timing(_value, _statBucket);

            actualGauge.ShouldStartWith($"{prefix}.");
            actualDecrement.ShouldStartWith($"{prefix}.");
            actualIncrement.ShouldStartWith($"{prefix}.");
            actualTiming.ShouldStartWith($"{prefix}.");
        }
Пример #4
0
        public void IncrementingMultipleCountersIsCorrect()
        {
            // Arrange
            var target = new StatsDMessageFormatter();

            // Act
            string actual = target.Increment(_value, _statBuckets);

            // Assert
            var expected = new StringBuilder();

            foreach (var stat in _statBuckets)
            {
                expected.AppendFormat(CultureInfo.InvariantCulture, "{0}:{1}|c", stat, _value);
            }

            actual.ShouldBe(expected.ToString());
        }
 public void Increment(string bucket)
 {
     _transport.Send(_formatter.Increment(bucket));
 }
Пример #6
0
 public void Increment(string bucket)
 {
     Send(_formatter.Increment(bucket));
 }