public JsonSerializationTests() { var eventFields = new Dictionary <string, object>(); eventFields.Add("field", "value"); eventFields.Add("abc", "123"); eventValue = new EventValue(new List <EventDetails> { new EventDetails(eventFields, new DateTime(1, 1, 1)) }); this.timerValue = new TimerValue(this.meterValue, this.histogramValue, 0, 1, TimeUnit.Nanoseconds); this.counter = new CounterValueSource("test1", Provider(counterValue), Unit.Errors, MetricTags.None); this.meter = new MeterValueSource("test2", Provider(meterValue), Unit.Calls, TimeUnit.Seconds, MetricTags.None); this.histogram = new HistogramValueSource("test3", Provider(histogramValue), Unit.Items, MetricTags.None); this.timer = new TimerValueSource("test4", Provider(timerValue), Unit.Requests, TimeUnit.Seconds, TimeUnit.Milliseconds, MetricTags.None); this.evnt = new EventValueSource("test5", Provider(eventValue), MetricTags.None); this.data = new MetricsData("test", new DateTime(2014, 2, 17), new[] { new EnvironmentEntry("name", "1") }, new[] { gauge }, new[] { counter }, new[] { meter }, new[] { histogram }, new[] { timer }, new[] { evnt }, Enumerable.Empty <MetricsData>() ); this.jsonContext = JsonMetricsContext.FromContext(this.data, "1"); }
public JsonSerializationTests() { this.timerValue = new TimerValue(this.meterValue, this.histogramValue, 0, 1, TimeUnit.Nanoseconds); this.counter = new CounterValueSource("test1", Provider(counterValue), Unit.Errors, MetricTags.None); this.meter = new MeterValueSource("test2", Provider(meterValue), Unit.Calls, TimeUnit.Seconds, MetricTags.None); this.histogram = new HistogramValueSource("test3", Provider(histogramValue), Unit.Items, MetricTags.None); this.timer = new TimerValueSource("test4", Provider(timerValue), Unit.Requests, TimeUnit.Seconds, TimeUnit.Milliseconds, MetricTags.None); this.data = new MetricsData("test", new DateTime(2014, 2, 17), new[] { new EnvironmentEntry("name", "1") }, new[] { gauge }, new[] { counter }, new[] { meter }, new[] { histogram }, new[] { timer }, Enumerable.Empty <MetricsData>() ); this.jsonContext = JsonMetricsContext.FromContext(this.data, "1"); }