public ThreadPoolSchedulingStatsCollector(
     IMetricFactory metricFactory,
     IMemoryCache memoryCache,
     ICollectorExceptionHandler errorHandler,
     RuntimeStatCollectorsConfiguration configuration) : base(errorHandler)
 {
     _eventTimer = new EventTimer(
         memoryCache,
         EventIdThreadPoolEnqueueWork,
         EventIdThreadPoolDequeueWork,
         x => (long)x.Payload[0],
         "tpoolsched");
     ScheduledCount = metricFactory.CreateCounter("dotnet_threadpool_scheduled_total", "The total number of items the thread pool has been instructed to execute");
     ScheduleDelay  = metricFactory.CreateHistogram(
         "dotnet_threadpool_scheduling_delay_seconds",
         "A breakdown of the latency experienced between an item being scheduled for execution on the thread pool and it starting execution.",
         buckets: configuration.HistogramBuckets);
 }
예제 #2
0
 public GcStatsCollector(
     IMetricFactory metricFactory,
     IMemoryCache memoryCache,
     ICollectorExceptionHandler errorHandler,
     RuntimeStatCollectorsConfiguration configuration) : base(errorHandler)
 {
     _memoryCache = memoryCache;
     _eventTimer  = new EventTimer(
         memoryCache,
         GCStart_V1,
         GCEnd_V1,
         x => Convert.ToInt64(x.Payload[0]), "gc");
     GcReasons = metricFactory.CreateCounter(
         "dotnet_gc_reason_total",
         "A tally of all the reasons that lead to garbage collections being run",
         false,
         "gc_gen",
         "gc_reason",
         "gc_type");
     GcDuration = metricFactory.CreateHistogram(
         "dotnet_gc_duration",
         "The amount of time spent running garbage collections",
         false,
         configuration.HistogramBuckets,
         "gc_gen",
         "gc_reason",
         "gc_type");
     GcHeapSizeInBytes = metricFactory.CreateGauge(
         "dotnet_gc_heap_size_bytes",
         "The current size of all heaps (only updated after a garbage collection)",
         false,
         "gc_gen");
     LargeObjectAllocationTypeTrigger = metricFactory.CreateCounter(
         "dotnet_gc_loh_type_trigger_total",
         "Objects that triggered Large Object Heap allocation",
         false,
         "type_name");
 }
예제 #3
0
 public HistogramController(IMetricFactory metricFactory)
 {
     _histogram = metricFactory.CreateHistogram("test_hist", "help_text", "params1", "params2");
 }
 public static IMetricFamily <IHistogram, ValueTuple <string> > CreateHistogram(this IMetricFactory factory, string name, string help, string labelName, bool includeTimestamp = false, double[] buckets = null)
 {
     return(factory.CreateHistogram(name, help, ValueTuple.Create(labelName), includeTimestamp, buckets));
 }
예제 #5
0
 public IHistogram Creation()
 {
     return(_factory.CreateHistogram("histogram", string.Empty));
 }
 /// <summary>
 ///     Create Histogram.
 /// </summary>
 /// <param name="factory">Metric factory</param>
 /// <param name="name">Name.</param>
 /// <param name="help">Help text.</param>
 /// <param name="buckets">Buckets.</param>
 /// <param name="labelNames">Array of label names.</param>
 public static IMetricFamily <IHistogram> CreateHistogram(this IMetricFactory factory, string name, string help, double[] buckets, params string[] labelNames)
 {
     return(factory.CreateHistogram(name, help, false, buckets, labelNames));
 }
 /// <summary>
 ///     Create Histogram.
 /// </summary>
 /// <param name="factory">Metric factory</param>
 /// <param name="name">Name.</param>
 /// <param name="help">Help text.</param>
 /// <param name="includeTimestamp">Include unix timestamp for metric.</param>
 /// <param name="labelNames">Array of label names.</param>
 public static IMetricFamily <IHistogram> CreateHistogram(this IMetricFactory factory, string name, string help, bool includeTimestamp, params string[] labelNames)
 {
     return(factory.CreateHistogram(name, help, includeTimestamp, null, labelNames));
 }
 public ICollector <IHistogram> CreateHistogram(string name, string help, HistogramConfiguration?configuration = null)
 => _factory.CreateHistogram(name, help, configuration);