public MetricsManager(IDriverMetricsProvider driverMetricsProvider, DriverMetricsOptions metricsOptions, bool metricsEnabled, string sessionName) { _driverMetricsProvider = driverMetricsProvider; _metricsOptions = metricsOptions; _metricsEnabled = metricsEnabled; _sessionBucket = metricsOptions.BucketPrefix != null ? $"{metricsOptions.BucketPrefix}.{sessionName}" : sessionName; _sessionMetrics = new SessionMetrics(_driverMetricsProvider, metricsOptions, metricsEnabled, _sessionBucket); _nodeMetricsRegistryCollection = new CopyOnWriteDictionary <Host, IMetricsRegistry <NodeMetric> >(); _nodeMetricsCollection = new CopyOnWriteDictionary <Host, INodeMetrics>(); _disabledSessionTimerMetrics = !metricsEnabled || !metricsOptions.EnabledSessionMetrics.Contains(SessionMetric.Timers.CqlRequests); _disabledNodeTimerMetrics = !metricsEnabled || !metricsOptions.EnabledNodeMetrics.Contains(NodeMetric.Timers.CqlMessages); }
public MetricsConnectionObserver(ISessionMetrics sessionMetrics, INodeMetrics nodeMetrics, bool enabledNodeTimerMetrics) { _sessionMetrics = sessionMetrics; _nodeMetrics = nodeMetrics; _enabledNodeTimerMetrics = enabledNodeTimerMetrics; }