Class MetricsExtensions
Extension methods to integrate App.Metrics with the DataStax Enterprise C# Driver.
Inheritance
Inherited Members
Namespace: Dse
Assembly: Dse.AppMetrics.dll
Syntax
public static class MetricsExtensions
Methods
CreateDriverMetricsProvider(IMetricsRoot)
Creates a IDriverMetricsProvider based on AppMetrics with the provided App.Metrics.IMetricsRoot.
Declaration
public static IDriverMetricsProvider CreateDriverMetricsProvider(this IMetricsRoot appMetrics)
Parameters
Type | Name | Description |
---|---|---|
App.Metrics.IMetricsRoot | appMetrics |
Returns
Type | Description |
---|---|
IDriverMetricsProvider |
CreateDriverMetricsProvider(IMetricsRoot, DriverAppMetricsOptions)
Creates a IDriverMetricsProvider based on AppMetrics with the provided App.Metrics.IMetricsRoot.
Declaration
public static IDriverMetricsProvider CreateDriverMetricsProvider(this IMetricsRoot appMetrics, DriverAppMetricsOptions options)
Parameters
Type | Name | Description |
---|---|---|
App.Metrics.IMetricsRoot | appMetrics | |
DriverAppMetricsOptions | options |
Returns
Type | Description |
---|---|
IDriverMetricsProvider |
GetNodeCounter(IDriverMetrics, Host, NodeMetric)
Utility method that wraps a call to GetNodeMetric<TMetricType>(Host, NodeMetric) with the appropriate AppMetrics based counter type as the type parameter. For more information see the API docs of GetNodeMetric<TMetricType>(Host, NodeMetric).
Declaration
public static IAppMetricsCounter GetNodeCounter(this IDriverMetrics driverMetrics, Host host, NodeMetric nodeMetric)
Parameters
Type | Name | Description |
---|---|---|
IDriverMetrics | driverMetrics | |
Host | host | |
NodeMetric | nodeMetric |
Returns
Type | Description |
---|---|
IAppMetricsCounter |
GetNodeGauge(IDriverMetrics, Host, NodeMetric)
Utility method that wraps a call to GetNodeMetric<TMetricType>(Host, NodeMetric) with the appropriate AppMetrics based gauge type as the type parameter. For more information see the API docs of GetNodeMetric<TMetricType>(Host, NodeMetric).
Declaration
public static IAppMetricsGauge GetNodeGauge(this IDriverMetrics driverMetrics, Host host, NodeMetric nodeMetric)
Parameters
Type | Name | Description |
---|---|---|
IDriverMetrics | driverMetrics | |
Host | host | |
NodeMetric | nodeMetric |
Returns
Type | Description |
---|---|
IAppMetricsGauge |
GetNodeMeter(IDriverMetrics, Host, NodeMetric)
Utility method that wraps a call to GetNodeMetric<TMetricType>(Host, NodeMetric) with the appropriate AppMetrics based meter type as the type parameter. For more information see the API docs of GetNodeMetric<TMetricType>(Host, NodeMetric).
Declaration
public static IAppMetricsMeter GetNodeMeter(this IDriverMetrics driverMetrics, Host host, NodeMetric nodeMetric)
Parameters
Type | Name | Description |
---|---|---|
IDriverMetrics | driverMetrics | |
Host | host | |
NodeMetric | nodeMetric |
Returns
Type | Description |
---|---|
IAppMetricsMeter |
GetNodeTimer(IDriverMetrics, Host, NodeMetric)
Utility method that wraps a call to GetNodeMetric<TMetricType>(Host, NodeMetric) with the appropriate AppMetrics based timer type as the type parameter. For more information see the API docs of GetNodeMetric<TMetricType>(Host, NodeMetric).
Declaration
public static IAppMetricsTimer GetNodeTimer(this IDriverMetrics driverMetrics, Host host, NodeMetric nodeMetric)
Parameters
Type | Name | Description |
---|---|---|
IDriverMetrics | driverMetrics | |
Host | host | |
NodeMetric | nodeMetric |
Returns
Type | Description |
---|---|
IAppMetricsTimer |
GetSessionCounter(IDriverMetrics, SessionMetric)
Utility method that wraps a call to GetSessionMetric<TMetricType>(SessionMetric) with the appropriate AppMetrics based counter type as the type parameter. For more information see the API docs of GetSessionMetric<TMetricType>(SessionMetric).
Declaration
public static IAppMetricsCounter GetSessionCounter(this IDriverMetrics driverMetrics, SessionMetric sessionMetric)
Parameters
Type | Name | Description |
---|---|---|
IDriverMetrics | driverMetrics | |
SessionMetric | sessionMetric |
Returns
Type | Description |
---|---|
IAppMetricsCounter |
GetSessionGauge(IDriverMetrics, SessionMetric)
Utility method that wraps a call to GetSessionMetric<TMetricType>(SessionMetric) with the appropriate AppMetrics based gauge type as the type parameter. For more information see the API docs of GetSessionMetric<TMetricType>(SessionMetric).
Declaration
public static IAppMetricsGauge GetSessionGauge(this IDriverMetrics driverMetrics, SessionMetric sessionMetric)
Parameters
Type | Name | Description |
---|---|---|
IDriverMetrics | driverMetrics | |
SessionMetric | sessionMetric |
Returns
Type | Description |
---|---|
IAppMetricsGauge |
GetSessionMeter(IDriverMetrics, SessionMetric)
Utility method that wraps a call to GetSessionMetric<TMetricType>(SessionMetric) with the appropriate AppMetrics based meter type as the type parameter. For more information see the API docs of GetSessionMetric<TMetricType>(SessionMetric).
Declaration
public static IAppMetricsMeter GetSessionMeter(this IDriverMetrics driverMetrics, SessionMetric sessionMetric)
Parameters
Type | Name | Description |
---|---|---|
IDriverMetrics | driverMetrics | |
SessionMetric | sessionMetric |
Returns
Type | Description |
---|---|
IAppMetricsMeter |
GetSessionTimer(IDriverMetrics, SessionMetric)
Utility method that wraps a call to GetSessionMetric<TMetricType>(SessionMetric) with the appropriate AppMetrics based timer type as the type parameter. For more information see the API docs of GetSessionMetric<TMetricType>(SessionMetric).
Declaration
public static IAppMetricsTimer GetSessionTimer(this IDriverMetrics driverMetrics, SessionMetric sessionMetric)
Parameters
Type | Name | Description |
---|---|---|
IDriverMetrics | driverMetrics | |
SessionMetric | sessionMetric |
Returns
Type | Description |
---|---|
IAppMetricsTimer |
ToAppMetricsCounter(IDriverCounter)
Casts the provided counter to the counter implementation of this provider.
Declaration
public static IAppMetricsCounter ToAppMetricsCounter(this IDriverCounter counter)
Parameters
Type | Name | Description |
---|---|---|
IDriverCounter | counter |
Returns
Type | Description |
---|---|
IAppMetricsCounter |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If the counter was not created by the AppMetrics provider (CreateDriverMetricsProvider(IMetricsRoot)). |
ToAppMetricsGauge(IDriverGauge)
Casts the provided gauge to the gauge implementation of this provider.
Declaration
public static IAppMetricsGauge ToAppMetricsGauge(this IDriverGauge gauge)
Parameters
Type | Name | Description |
---|---|---|
IDriverGauge | gauge |
Returns
Type | Description |
---|---|
IAppMetricsGauge |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If the gauge was not created by the AppMetrics provider (CreateDriverMetricsProvider(IMetricsRoot)). |
ToAppMetricsMeter(IDriverMeter)
Casts the provided meter to the meter implementation of this provider.
Declaration
public static IAppMetricsMeter ToAppMetricsMeter(this IDriverMeter meter)
Parameters
Type | Name | Description |
---|---|---|
IDriverMeter | meter |
Returns
Type | Description |
---|---|
IAppMetricsMeter |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If the meter was not created by the AppMetrics provider (CreateDriverMetricsProvider(IMetricsRoot)). |
ToAppMetricsTimer(IDriverTimer)
Casts the provided timer to the timer implementation of this provider.
Declaration
public static IAppMetricsTimer ToAppMetricsTimer(this IDriverTimer timer)
Parameters
Type | Name | Description |
---|---|---|
IDriverTimer | timer |
Returns
Type | Description |
---|---|
IAppMetricsTimer |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If the timer was not created by the AppMetrics provider (CreateDriverMetricsProvider(IMetricsRoot)). |