public override void Start() { _monitors.addMonitorListener(_listener); LogRotationMonitor monitor = this._logRotationMonitorSupplier.get(); _registry.register(LogRotationEvents, (Gauge <long>)monitor.numberOfLogRotationEvents); _registry.register(LogRotationTotalTime, (Gauge <long>)monitor.logRotationAccumulatedTotalTimeMillis); }
public override void Start() { _monitors.addMonitorListener(_listener); CheckPointerMonitor checkPointerMonitor = _checkPointerMonitorSupplier.get(); _registry.register(CheckPointEvents, (Gauge <long>)checkPointerMonitor.numberOfCheckPointEvents); _registry.register(CheckPointTotalTime, (Gauge <long>)checkPointerMonitor.checkPointAccumulatedTotalTimeMillis); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void metricsRegisteredAfterStartShouldBeIncluded() throws Throwable //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void MetricsRegisteredAfterStartShouldBeIncluded() { MetricRegistry registry = new MetricRegistry(); DynamicAddressPrometheusOutput dynamicOutput = new DynamicAddressPrometheusOutput("localhost", registry, mock(typeof(Log))); System.Action <long> callback = l => { SortedDictionary <string, Gauge> gauges = new SortedDictionary <string, Gauge>(); gauges.put("my.event", () => l); dynamicOutput.Report(gauges, emptySortedMap(), emptySortedMap(), emptySortedMap(), emptySortedMap()); }; registry.register("my.metric", ( Gauge )() => 10); dynamicOutput.Init(); dynamicOutput.Start(); callback(20); string serverAddress = dynamicOutput.ServerAddress; string response = GetResponse(serverAddress); assertTrue(response.Contains("my_metric 10.0")); assertTrue(response.Contains("my_event 20.0")); }
public override void Report(SortedDictionary <string, Gauge> gauges, SortedDictionary <string, Counter> counters, SortedDictionary <string, Histogram> histograms, SortedDictionary <string, Meter> meters, SortedDictionary <string, Timer> timers) { // Prometheus does not support events, just output the latest event that occurred string metricKey = gauges.firstKey(); if (!_registeredEvents.ContainsKey(metricKey)) { _eventRegistry.register(metricKey, ( Gauge )() => _registeredEvents[metricKey]); } _registeredEvents[metricKey] = gauges[metricKey].Value; }
public override void Start() { _registry.register(ThreadJettyIdle, (Gauge <int>)() => _serverThreadView.idleThreads()); _registry.register(ThreadJettyAll, (Gauge <int>)() => _serverThreadView.allThreads()); }
public override void Start() { _registry.register(ThreadCount, (Gauge <int>)Thread.activeCount); _registry.register(ThreadTotal, (Gauge <int>)_threadMXBean.getThreadCount); }