/// <summary> /// Create HTTP endpoint where metrics will be available in various formats: /// GET / => visualization application /// GET /json => metrics serialized as JSON /// GET /text => metrics in human readable text format /// </summary> /// <param name="httpUriPrefix">prefix where to start HTTP endpoint</param> /// <returns>Chain-able configuration object.</returns> public MetricsConfig WithHttpEndpoint(string httpUriPrefix) { if (!isDisabled) { using (this.listener) { } this.listener = new MetricsHttpListener(httpUriPrefix, this.context.DataProvider, this.healthStatus); this.listener.Start(); } return(this); }
private void DisableAllReports() { this.reports.StopAndClearAllReports(); using (this.listener) { } this.listener = null; }
private static Task <MetricsHttpListener> StartListener(string endpoint) { var context = new TestContext(); return(MetricsHttpListener.StartHttpListenerAsync(Endpoint(endpoint), context.DataProvider, () => new HealthStatus(), CancellationToken.None)); }
public void Dispose() { this.reports.Dispose(); using (this.listener) { } this.listener = null; }
private static Task <MetricsHttpListener> StartListener(string endpoint) { var context = new TestContext(); return(MetricsHttpListener.StartHttpListenerAsync(Endpoint(endpoint), Enumerable.Empty <MetricsEndpoint>(), CancellationToken.None)); }