//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")); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void eventsShouldBeRedirectedToGauges() throws Throwable //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void EventsShouldBeRedirectedToGauges() { 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()); }; callback(10); dynamicOutput.Init(); dynamicOutput.Start(); string serverAddress = dynamicOutput.ServerAddress; assertTrue(GetResponse(serverAddress).Contains("my_event 10.0")); assertTrue(GetResponse(serverAddress).Contains("my_event 10.0")); callback(20); assertTrue(GetResponse(serverAddress).Contains("my_event 20.0")); assertTrue(GetResponse(serverAddress).Contains("my_event 20.0")); }