Beispiel #1
0
 public void ResolveHistogramFromRegistry()
 {
     // ReSharper disable UnusedVariable
     var metric = _registry.Histogram(
         // ReSharper restore UnusedVariable
         HistogramOptions,
         () => HistogramBuilder.Build(HistogramOptions.Reservoir));
 }
        public void can_build_with_reservoir()
        {
            var reservoirMock = new Mock <IReservoir>();

            reservoirMock.Setup(r => r.Update(It.IsAny <long>()));
            reservoirMock.Setup(r => r.GetSnapshot()).Returns(() => new UniformSnapshot(100, 100.0, new long[100]));
            reservoirMock.Setup(r => r.Reset());

            var histogram = _builder.Build(() => reservoirMock.Object);

            histogram.Should().NotBeNull();
        }
 /// <inheritdoc />
 public void Update(HistogramOptions options, long value)
 {
     _registry.Histogram(options, () => _histogramBuilder.Build(options.Reservoir)).Update(value);
 }
Beispiel #4
0
 /// <inheritdoc />
 public IHistogram Instance(HistogramOptions options)
 {
     return(Instance(options, () => _histogramBuilder.Build(options.Reservoir)));
 }
Beispiel #5
0
 public void ResolveHistogramFromRegistry()
 {
     _registry.Histogram(
         HistogramOptions,
         () => HistogramBuilder.Build(HistogramOptions.Reservoir));
 }