Ejemplo n.º 1
0
 /// <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);
 }
Ejemplo n.º 2
0
 private void DisableAllReports()
 {
     this.reports.StopAndClearAllReports();
     using (this.listener) { }
     this.listener = null;
 }
Ejemplo n.º 3
0
        private static Task <MetricsHttpListener> StartListener(string endpoint)
        {
            var context = new TestContext();

            return(MetricsHttpListener.StartHttpListenerAsync(Endpoint(endpoint), context.DataProvider, () => new HealthStatus(), CancellationToken.None));
        }
Ejemplo n.º 4
0
 public void Dispose()
 {
     this.reports.Dispose();
     using (this.listener) { }
     this.listener = null;
 }
Ejemplo n.º 5
0
        private static Task <MetricsHttpListener> StartListener(string endpoint)
        {
            var context = new TestContext();

            return(MetricsHttpListener.StartHttpListenerAsync(Endpoint(endpoint), Enumerable.Empty <MetricsEndpoint>(), CancellationToken.None));
        }