コード例 #1
0
        public HttpClientCoreObserver(IMetricsObserverOptions options, IStats stats, ILogger <HttpClientCoreObserver> logger)
            : base(OBSERVER_NAME, DIAGNOSTIC_NAME, options, stats, logger)
        {
            PathMatcher         = new Regex(options.EgressIgnorePattern);
            _clientTimeMeasure  = Meter.CreateDoubleMeasure("http.client.request.time");
            _clientCountMeasure = Meter.CreateInt64Measure("http.client.request.count");

            /* TODO: figureout bound instruments & view API
             * var view = View.Create(
             *      ViewName.Create("http.client.request.time"),
             *      "Total request time",
             *      clientTimeMeasure,
             *      Distribution.Create(BucketBoundaries.Create(new List<double>() { 0.0, 1.0, 5.0, 10.0, 100.0 })),
             *      new List<ITagKey>() { statusTagKey, uriTagKey, methodTagKey, clientTagKey });
             * ViewManager.RegisterView(view);
             *
             * view = View.Create(
             *  ViewName.Create("http.client.request.count"),
             *  "Total request counts",
             *  clientCountMeasure,
             *  Sum.Create(),
             *  new List<ITagKey>() { statusTagKey, uriTagKey, methodTagKey, clientTagKey });
             *
             * ViewManager.RegisterView(view);
             */
        }
コード例 #2
0
ファイル: GCEventsListener.cs プロジェクト: gregolm/Steeltoe
 public GCEventsListener(IStats stats, ILogger <EventSourceListener> logger = null)
     : base(stats)
 {
     _logger          = logger;
     _memoryUsed      = Meter.CreateInt64Measure("clr.memory.used");
     _collectionCount = Meter.CreateInt64Measure("clr.gc.collections");
 }
コード例 #3
0
        public CLRRuntimeObserver(IMetricsObserverOptions options, IStats stats, ILogger <CLRRuntimeObserver> logger)
            : base(OBSERVER_NAME, DIAGNOSTIC_NAME, options, stats, logger)
        {
            _memoryUsed      = Meter.CreateInt64Measure("clr.memory.used");
            _collectionCount = Meter.CreateInt64Measure("clr.gc.collections");
            _activeThreads   = Meter.CreateInt64Measure("clr.threadpool.active");
            _availThreads    = Meter.CreateInt64Measure("clr.threadpool.avail");

            // TODO: Pending View API
            // memoryTagValues = Tagger.CurrentBuilder.Put(memoryAreaKey, heapArea).Build();
            // threadPoolWorkerTagValues = Tagger.CurrentBuilder.Put(threadKindKey, threadPoolWorkerKind).Build();
            // threadPoolCompPortTagValues = Tagger.CurrentBuilder.Put(threadKindKey, threadPoolComppKind).Build();

            // RegisterViews();
        }
コード例 #4
0
 public ThreadPoolEventsListener(IStats stats, ILogger <EventSourceListener> logger = null)
     : base(stats)
 {
     _logger           = logger;
     _availableThreads = Meter.CreateInt64Measure($"clr.threadpool.available");
 }