/// <summary> /// Initializes a new instance of the <see cref="MetricConfigurationV2"/> struct. /// </summary> /// <param name="metricName">Name of the metric.</param> /// <param name="scalingFactor">The scaling factor.</param> /// <param name="samplingTypes">The sampling types.</param> public MetricConfigurationV2(string metricName, float?scalingFactor, SamplingTypes samplingTypes) : this() { this.MetricName = metricName; this.ScalingFactor = scalingFactor; this.SamplingTypes = samplingTypes; this.EnableClientSideForking = true; this.EnableClientSidePublication = true; this.EnableClientSideEtwPublication = true; this.IngestionOptions = 0; this.HyperLogLogBValue = HyperLogLogSketch.DefaultBValue; }
/// <summary> /// A Histogram measures the distribution of values in a stream of data: e.g., the number of results returned by a search. /// </summary> /// <param name="name">Name of the metric. Must be unique across all histograms in this context.</param> /// <param name="unit">Description of what the is being measured ( Unit.Requests , Unit.Items etc ) .</param> /// <param name="samplingType">Type of the sampling to use (see SamplingType for details ).</param> /// <param name="tag">Optional tag that can be associated with the metric.</param> /// <returns>Reference to the metric</returns> public IHistogram Histogram(string name, Units unit, SamplingTypes samplingType = SamplingTypes.FavorRecent, string tag = null) { return new Histogram(_context.Histogram(name, unit.ToString(), (SamplingType)samplingType, tag)); }
public ITimer Timer(string name, Units unit, SamplingTypes samplingType = SamplingTypes.FavorRecent, TimeUnits rateUnit = TimeUnits.Seconds, TimeUnits durationUnit = TimeUnits.Milliseconds, List <KeyValuePair <string, string> > tags = null) { return(_timer); }
public IHistogram Histogram(string name, Units unit, SamplingTypes samplingType = SamplingTypes.FavorRecent, List <KeyValuePair <string, string> > tags = null) { return(_histogram); }
public ITimer Timer(string name, Units unit, SamplingTypes samplingType, TimeUnits rateUnit, TimeUnits durationUnit, List <KeyValuePair <string, string> > tags = null) { return(_timer); }
/// <inheritdoc /> public ITimer Timer(string name, Units unit, SamplingTypes samplingType = SamplingTypes.FavorRecent, TimeUnits rateUnit = TimeUnits.Seconds, TimeUnits durationUnit = TimeUnits.Milliseconds, string tag = null) { return(new Timer(_context.Timer(name, unit.ToString(), (SamplingType)samplingType, (TimeUnit)rateUnit, (TimeUnit)durationUnit, tag))); }
/// <inheritdoc /> public IHistogram Histogram(string name, Units unit, SamplingTypes samplingType = SamplingTypes.FavorRecent, List <KeyValuePair <string, string> > tags = null) { return(MetricsStatic.Histogram(_context, name, unit, samplingType)); }
/// <inheritdoc /> public ITimer Timer(string name, Units unit, SamplingTypes samplingType, TimeUnits rateUnit, TimeUnits durationUnit, string tag = null) { return(new TimerNoOp()); }
/// <inheritdoc /> public ITimer Timer(string name, Units unit, SamplingTypes samplingType = SamplingTypes.FavorRecent, TimeUnits rateUnit = TimeUnits.Seconds, TimeUnits durationUnit = TimeUnits.Milliseconds, string tag = null) { return(new TimerNoOp()); }
public static IHistogram Histogram(App.Metrics.IMetrics context, string name, Units unit, SamplingTypes samplingType, List <KeyValuePair <string, string> > tags = null) { var options = new App.Metrics.Histogram.HistogramOptions { MeasurementUnit = unit.GetUnit(), Name = name, Tags = tags.GetTags() }; switch (samplingType) { case SamplingTypes.FavorRecent: options.Reservoir = () => new App.Metrics.ReservoirSampling.ExponentialDecay.DefaultForwardDecayingReservoir(1024, 0.015, 0); break; case SamplingTypes.LongTerm: options.Reservoir = () => new App.Metrics.ReservoirSampling.Uniform.DefaultAlgorithmRReservoir(1024); break; case SamplingTypes.SlidingWindow: options.Reservoir = () => new App.Metrics.ReservoirSampling.SlidingWindow.DefaultSlidingWindowReservoir(1024); break; default: throw new ArgumentOutOfRangeException(nameof(samplingType), samplingType, null); } return(new Histogram(context.Provider.Histogram.Instance(options))); }
public static ITimer Timer(App.Metrics.IMetrics context, string name, Units unit, SamplingTypes samplingType, TimeUnits rateUnit, TimeUnits durationUnit, List <KeyValuePair <string, string> > tags = null) { var options = new App.Metrics.Timer.TimerOptions { MeasurementUnit = unit.GetUnit(), Name = name, DurationUnit = (App.Metrics.TimeUnit)durationUnit, RateUnit = (App.Metrics.TimeUnit)rateUnit, Tags = tags.GetTags() }; return(new Timer(context.Provider.Timer.Instance(options))); }
/// <inheritdoc /> public ITimer Timer(string name, Units unit, SamplingTypes samplingType, TimeUnits rateUnit, TimeUnits durationUnit, string tag = null) { return(new Timer(_context.Timer(name, unit.ToString(), (SamplingType)samplingType, (TimeUnit)rateUnit, (TimeUnit)durationUnit, tag))); }
/// <inheritdoc /> public IHistogram Histogram(string name, Units unit, SamplingTypes samplingType, string tag = null) { return(new Histogram(_context.Histogram(name, unit.ToString(), (SamplingType)samplingType, tag))); }
/// <summary> /// A timer is basically a histogram of the duration of a type of event and a meter of the rate of its occurrence. /// </summary> /// <param name="name">Name of the metric. Must be unique across all timers in this context.</param> /// <param name="unit">Description of what the is being measured ( Unit.Requests , Unit.Items etc ) .</param> /// <param name="samplingType">Type of the sampling to use (see SamplingType for details ).</param> /// <param name="rateUnit">Time unit for rates reporting. Defaults to Second ( occurrences / second ).</param> /// <param name="durationUnit">Time unit for reporting durations. Defaults to Milliseconds. </param> /// <param name="tag">Optional tag that can be associated with the metric.</param> /// <returns>Reference to the metric</returns> public ITimer Timer(string name, Units unit, SamplingTypes samplingType = SamplingTypes.FavorRecent, TimeUnits rateUnit = TimeUnits.Seconds, TimeUnits durationUnit = TimeUnits.Milliseconds, string tag = null) { return new Timer(_context.Timer(name, unit.ToString(), (SamplingType)samplingType, (TimeUnit)rateUnit, (TimeUnit)durationUnit, tag)); }
public static bool Includes(this SamplingTypes samplingTypes, SamplingTypes value) { return((samplingTypes & value) == value); }
/// <inheritdoc /> public IHistogram Histogram(string name, Units unit, SamplingTypes samplingType, string tag = null) { return(new HistogramNoOp()); }
/// <inheritdoc /> public IHistogram Histogram(string name, Units unit, SamplingTypes samplingType, List <KeyValuePair <string, string> > tags = null) { return(new HistogramNoOp()); }
/// <inheritdoc /> public ITimer Timer(string name, Units unit, SamplingTypes samplingType, TimeUnits rateUnit, TimeUnits durationUnit, List <KeyValuePair <string, string> > tags = null) { return(MetricsStatic.Timer(_context, name, unit, samplingType, rateUnit, durationUnit, tags)); }
/// <summary> /// A timer is basically a histogram of the duration of a type of event and a meter of the rate of its occurrence. /// </summary> /// <param name="name">Name of the metric. Must be unique across all timers in this context.</param> /// <param name="unit">Description of what the is being measured ( Unit.Requests , Unit.Items etc ) .</param> /// <param name="samplingType">Type of the sampling to use (see SamplingType for details ).</param> /// <param name="rateUnit">Time unit for rates reporting. Defaults to Second ( occurrences / second ).</param> /// <param name="durationUnit">Time unit for reporting durations. Defaults to Milliseconds.</param> /// <param name="tag">Optional tag that can be associated with the metric.</param> /// <returns> /// Reference to the metric /// </returns> public ITimer Timer(string name, Units unit, SamplingTypes samplingType, TimeUnits rateUnit, TimeUnits durationUnit, string tag = null) { return new Timer(_context.Timer(name, unit.ToString(), (SamplingType)samplingType, (TimeUnit)rateUnit, (TimeUnit)durationUnit, tag)); }
/// <inheritdoc /> public ITimer Timer(string name, Units unit, SamplingTypes samplingType = SamplingTypes.FavorRecent, TimeUnits rateUnit = TimeUnits.Seconds, TimeUnits durationUnit = TimeUnits.Milliseconds, List <KeyValuePair <string, string> > tags = null) { return(MetricsStatic.Timer(_context, name, unit, samplingType, rateUnit, durationUnit, tags)); }
public IHistogram Histogram(string name, Units unit, SamplingTypes samplingType = SamplingTypes.FavorRecent, string tag = null) { return(_histogram); }