public LocalDataChannelMetrics(MetricsRegistry registry)
 {
     _registry     = registry;
     _failures     = _registry.MakeMeter(LocalFailuresOptions);
     _frameRead    = _registry.MakeMeter(LocalFrameReadOptions);
     _frameWritten = _registry.MakeMeter(LocalFrameWrittenOptions);
     _bytesRead    = _registry.MakeMeter(LocalBytesReadOptions);
     _bytesWritten = _registry.MakeMeter(LocalBytesWrittenOptions);
 }
 public RemoteDataChannelMetrics(MetricsRegistry registry)
 {
     _registry     = registry;
     _failures     = _registry.MakeMeter(RemoteFailuresOptions);
     _frameRead    = _registry.MakeMeter(RemoteFrameReadOptions);
     _frameWritten = _registry.MakeMeter(RemoteFrameWrittenOptions);
     _bytesRead    = _registry.MakeMeter(RemoteBytesReadOptions);
     _bytesWritten = _registry.MakeMeter(RemoteBytesWrittenOptions);
 }
        public TunnelMetrics(MetricsRegistry registry, MetricTags tags)
        {
            _tags = tags;

            var metrics = registry.Merge(_tags);

            Local  = new LocalDataChannelMetrics(metrics);
            Remote = new RemoteDataChannelMetrics(metrics);
            LocalEstablishedConnections = metrics.MakeMeter(LocalEstablishedConnectionsOptions);
            RemoteEstablishedTunnels    = metrics.MakeMeter(RemoteEstablishedTunnelsOptions);
        }
Example #4
0
        public static MetricsRegistry CreateRoot(IConfiguration configuration, Action <IMetricsBuilder> customBuild = null)
        {
            var options = configuration.GetSection("AgentMetrics")?.Get <AgentMetricsOptions>() ?? new AgentMetricsOptions();

            var builder = new MetricsBuilder()
                          .Configuration.Configure(options.MetricsOptions.ToMetricsOptions());

            BuildReporting(builder, options.ReportingOptions);

            customBuild?.Invoke(builder);

            var registry = new MetricsRegistry(builder.Build());

            registry.StartReportScheduler(options);

            return(registry);
        }