コード例 #1
0
        public void can_deserialize()
        {
            var jsonHistogram = MetricType.Histogram.SampleJson();

            var result = _serializer.Deserialize <HistogramValueSource>(jsonHistogram.ToString());

            result.Name.Should().BeEquivalentTo(_histogram.Name);
            result.Unit.Should().Be(_histogram.Unit);
            result.Value.Count.Should().Be(_histogram.Value.Count);
            result.Value.LastValue.Should().Be(_histogram.Value.LastValue);
            result.Value.LastUserValue.Should().Be(_histogram.Value.LastUserValue);
            result.Value.Max.Should().Be(_histogram.Value.Max);
            result.Value.MaxUserValue.Should().Be(_histogram.Value.MaxUserValue);
            result.Value.Mean.Should().Be(_histogram.Value.Mean);
            result.Value.Min.Should().Be(_histogram.Value.Min);
            result.Value.MinUserValue.Should().Be(_histogram.Value.MinUserValue);
            result.Value.StdDev.Should().Be(_histogram.Value.StdDev);
            result.Value.Median.Should().Be(_histogram.Value.Median);
            result.Value.Percentile75.Should().Be(_histogram.Value.Percentile75);
            result.Value.Percentile95.Should().Be(_histogram.Value.Percentile95);
            result.Value.Percentile98.Should().Be(_histogram.Value.Percentile98);
            result.Value.Percentile99.Should().Be(_histogram.Value.Percentile99);
            result.Value.Percentile999.Should().Be(_histogram.Value.Percentile999);
            result.Value.SampleSize.Should().Be(_histogram.Value.SampleSize);
            result.Tags.Keys.Should().Contain(_histogram.Tags.Keys.ToArray());
            result.Tags.Values.Should().Contain(_histogram.Tags.Values.ToArray());
        }
コード例 #2
0
        public void can_deserialize()
        {
            var jsonTimer = MetricType.Timer.SampleJson();

            var result = _serializer.Deserialize <TimerValueSource>(jsonTimer.ToString());

            result.Name.Should().BeEquivalentTo(_timer.Name);
            result.Unit.Should().Be(_timer.Unit);
            result.Value.Histogram.Count.Should().Be(_timer.Value.Histogram.Count);
            result.Value.Histogram.LastValue.Should().Be(_timer.Value.Histogram.LastValue);
            result.Value.Histogram.LastUserValue.Should().Be(_timer.Value.Histogram.LastUserValue);
            result.Value.Histogram.Max.Should().Be(_timer.Value.Histogram.Max);
            result.Value.Histogram.MaxUserValue.Should().Be(_timer.Value.Histogram.MaxUserValue);
            result.Value.Histogram.Mean.Should().Be(_timer.Value.Histogram.Mean);
            result.Value.Histogram.Min.Should().Be(_timer.Value.Histogram.Min);
            result.Value.Histogram.MinUserValue.Should().Be(_timer.Value.Histogram.MinUserValue);
            result.Value.Histogram.StdDev.Should().Be(_timer.Value.Histogram.StdDev);
            result.Value.Histogram.Median.Should().Be(_timer.Value.Histogram.Median);
            result.Value.Histogram.Percentile75.Should().Be(_timer.Value.Histogram.Percentile75);
            result.Value.Histogram.Percentile95.Should().Be(_timer.Value.Histogram.Percentile95);
            result.Value.Histogram.Percentile98.Should().Be(_timer.Value.Histogram.Percentile98);
            result.Value.Histogram.Percentile99.Should().Be(_timer.Value.Histogram.Percentile99);
            result.Value.Histogram.Percentile999.Should().Be(_timer.Value.Histogram.Percentile999);
            result.Value.Histogram.SampleSize.Should().Be(_timer.Value.Histogram.SampleSize);
            result.Value.Rate.Count.Should().Be(_timer.Value.Rate.Count);
            result.Value.Rate.FifteenMinuteRate.Should().Be(_timer.Value.Rate.FifteenMinuteRate);
            result.Value.Rate.FiveMinuteRate.Should().Be(_timer.Value.Rate.FiveMinuteRate);
            result.Value.Rate.OneMinuteRate.Should().Be(_timer.Value.Rate.OneMinuteRate);
            result.Value.Rate.MeanRate.Should().Be(_timer.Value.Rate.MeanRate);
            result.Value.Rate.RateUnit.Should().Be(_timer.Value.Rate.RateUnit);
            result.Value.ActiveSessions.Should().Be(_timer.Value.ActiveSessions);
            result.Value.TotalTime.Should().Be(_timer.Value.TotalTime);
            result.Tags.Should().ContainKeys(_timer.Tags.Select(t => t.Key));
            result.Tags.Should().ContainValues(_timer.Tags.Select(t => t.Value));
        }
コード例 #3
0
        public void can_deserialize()
        {
            var result = _serializer.Deserialize <GaugeValueSource>(MetricType.Gauge.SampleJson().ToString());

            result.Name.Should().BeEquivalentTo(_gauge.Name);
            result.Unit.Should().Be(_gauge.Unit);
            result.Value.Should().Be(_gauge.Value);
            result.Tags.Should().Be(_gauge.Tags);
        }
コード例 #4
0
        public void can_deserialize()
        {
            var json = MetricDataSamples.SingleContext.SampleJson();

            var result = _serializer.Deserialize <MetricsDataValueSource>(json.ToString());

            result.Timestamp.Should().Be(_metrics.Timestamp);
            result.Contexts.Count().Should().Be(_metrics.Contexts.Count());
            result.Environment.Entries.Count().Should().Be(_metrics.Environment.Entries.Count());
        }
コード例 #5
0
        public void can_deserialize()
        {
            var jsonCounter = MetricType.Counter.SampleJson();

            var result = _serializer.Deserialize <CounterValueSource>(jsonCounter.ToString());

            result.Name.Should().BeEquivalentTo(_counter.Name);
            result.Unit.Should().Be(_counter.Unit);
            result.Value.Count.Should().Be(_counter.Value.Count);
            result.Value.Items.Should().BeEquivalentTo(_counter.Value.Items);
            result.Tags.Should().Be(_counter.Tags);
        }
コード例 #6
0
        public void can_deserialize()
        {
            var jsonApdex = MetricType.Apdex.SampleJson();

            var result = _serializer.Deserialize <ApdexValueSource>(jsonApdex.ToString());

            result.Name.Should().BeEquivalentTo(_apdex.Name);
            result.Value.Score.Should().Be(_apdex.Value.Score);
            result.Value.SampleSize.Should().Be(_apdex.Value.SampleSize);
            result.Value.Satisfied.Should().Be(_apdex.Value.Satisfied);
            result.Value.Tolerating.Should().Be(_apdex.Value.Tolerating);
            result.Value.Frustrating.Should().Be(_apdex.Value.Frustrating);
            result.Tags.Should().ContainKeys(_apdex.Tags.Select(t => t.Key));
            result.Tags.Should().ContainValues(_apdex.Tags.Select(t => t.Value));
        }
コード例 #7
0
        public void can_deserialize()
        {
            var jsonMeter = MetricType.Meter.SampleJson();

            var result = _serializer.Deserialize <MeterValueSource>(jsonMeter.ToString());

            result.Name.Should().BeEquivalentTo(_meter.Name);
            result.Unit.Should().Be(_meter.Unit);
            result.Value.Count.Should().Be(_meter.Value.Count);
            result.Value.FifteenMinuteRate.Should().Be(_meter.Value.FifteenMinuteRate);
            result.Value.FiveMinuteRate.Should().Be(_meter.Value.FiveMinuteRate);
            result.Value.OneMinuteRate.Should().Be(_meter.Value.OneMinuteRate);
            result.Value.MeanRate.Should().Be(_meter.Value.MeanRate);
            result.Value.RateUnit.Should().Be(_meter.Value.RateUnit);
            result.Tags.Should().Be(_meter.Tags);
        }