• DataStax C# Driver for Apache Cassandra API Documentation
Search Results for

    Show / Hide Table of Contents
    • Cassandra
      • AesColumnEncryptionPolicy
      • AesColumnEncryptionPolicy.AesKeyAndIV
      • AggregateMetadata
      • AlreadyExistsException
      • AtomicMonotonicTimestampGenerator
      • AtomicMonotonicWinApiTimestampGenerator
      • AuthenticationException
      • BaseColumnEncryptionPolicy<TKey>
      • BaseColumnEncryptionPolicy<TKey>.ColMetadataKey
      • BatchStatement
      • BatchType
      • BigIntegerTypeAdapter
      • BoundStatement
      • Builder
      • BusyPoolException
      • CassandraConnectionStringBuilder
      • ClientOptions
      • Cluster
      • ColumnDesc
      • ColumnEncryptionInvalidTypeError
      • ColumnEncryptionMetadata
      • ColumnTypeCode
      • CompressionType
      • Configuration
      • ConsistencyLevel
      • ConstantReconnectionPolicy
      • ConstantSpeculativeExecutionPolicy
      • CqlColumn
      • CqlVector<T>
      • CustomColumnInfo
      • DCAwareRoundRobinPolicy
      • DataCollectionMetadata
      • DataCollectionMetadata.SortOrder
      • DecimalTypeAdapter
      • DefaultLoadBalancingPolicy
      • DefaultRetryPolicy
      • Diagnostics
      • DowngradingConsistencyRetryPolicy
      • DriverException
      • DriverInternalError
      • Duration
      • DynamicCompositeTypeAdapter
      • EC2MultiRegionTranslator
      • EncryptedValue
      • ExecutionException
      • ExecutionInfo
      • ExponentialReconnectionPolicy
      • Extensions
      • FallthroughRetryPolicy
      • FixedReconnectionPolicy
      • FunctionFailureException
      • FunctionMetadata
      • GraphProtocol
      • Host
      • HostDistance
      • HostsEventArgs
      • HostsEventArgs.Kind
      • HostsEventHandler
      • IAddressTranslator
      • IAuthProvider
      • IAuthenticator
      • ICluster
      • IColumnEncryptionPolicy
      • IColumnInfo
      • IExecutionProfile
      • IExecutionProfileBuilder
      • IExecutionProfileOptions
      • IExtendedRetryPolicy
      • IFrameCompressor
      • IInitializer
      • ILoadBalancingPolicy
      • IReconnectionPolicy
      • IReconnectionSchedule
      • IRequestTracker
      • IRetryPolicy
      • ISession
      • ISessionState
      • ISpeculativeExecutionPlan
      • ISpeculativeExecutionPolicy
      • IStatement
      • ITimestampGenerator
      • ITypeAdapter
      • IdempotenceAwareRetryPolicy
      • IndexMetadata
      • IndexMetadata.IndexKind
      • InitFatalErrorException
      • InvalidConfigurationInQueryException
      • InvalidQueryException
      • InvalidTypeException
      • IsBootstrappingException
      • KeyType
      • KeyspaceMetadata
      • ListColumnInfo
      • LocalDate
      • LocalTime
      • Logger
      • LoggingRetryPolicy
      • MapColumnInfo
      • MaterializedViewMetadata
      • Metadata
      • MetadataSyncOptions
      • MetricsExtensions
      • MonitorReportingOptions
      • NoHostAvailableException
      • NoSpeculativeExecutionPolicy
      • NodeRequestInfo
      • NoneAuthProvider
      • NullTypeAdapter
      • OperationTimedOutException
      • OverloadedException
      • PlainTextAuthProvider
      • Policies
      • PoolingOptions
      • PrepareRequest
      • PreparedQueryNotFoundException
      • PreparedStatement
      • PreparedStatementIdMismatchException
      • ProtocolErrorException
      • ProtocolOptions
      • ProtocolVersion
      • QueryExecutionException
      • QueryOptions
      • QueryProtocolOptions
      • QueryProtocolOptions.QueryFlags
      • QueryTimeoutException
      • QueryTrace
      • QueryTrace.Event
      • QueryValidationException
      • ReadFailureException
      • ReadTimeoutException
      • RegularStatement
      • ReplicationStrategies
      • RequestInvalidException
      • RetryDecision
      • RetryDecision.RetryDecisionType
      • RetryLoadBalancingPolicy
      • RetryLoadBalancingPolicyEventArgs
      • RoundRobinPolicy
      • RoutingKey
      • Row
      • RowSet
      • RowSetMetadata
      • SSLOptions
      • SchemaChangedEventArgs
      • SchemaChangedEventArgs.Kind
      • SchemaChangedEventHandler
      • ServerErrorException
      • Session
      • SessionRequestInfo
      • SetColumnInfo
      • SimpleStatement
      • SocketOptions
      • Statement
      • SyntaxError
      • TableColumn
      • TableMetadata
      • TableOptions
      • TimeUuid
      • ToManyConnectionsPerHost
      • TokenAwarePolicy
      • TraceRetrievalException
      • TruncateException
      • TupleColumnInfo
      • TypeAdapters
      • UdtColumnInfo
      • UdtMap
      • UdtMap<T>
      • UdtMappingDefinitions
      • UnauthorizedException
      • UnavailableException
      • Unset
      • VectorColumnInfo
      • WriteFailureException
      • WriteTimeoutException
    • Cassandra.AppMetrics
      • DriverAppMetricsOptions
    • Cassandra.AppMetrics.MetricTypes
      • IAppMetricsCounter
      • IAppMetricsGauge
      • IAppMetricsMeter
      • IAppMetricsMetric
      • IAppMetricsTimer
    • Cassandra.AppMetrics.MetricValues
      • IAppMetricsHistogramValue
      • IAppMetricsMeterValue
      • IAppMetricsMetricWithValue<T>
      • IAppMetricsTimerValue
    • Cassandra.Data
      • CqlBatchTransaction
      • CqlCommand
      • CqlConnection
      • CqlDataAdapter
      • CqlParameter
      • CqlParameterCollection
      • CqlProviderFactory
      • CqlReader
    • Cassandra.Data.Linq
      • AllowFilteringAttribute
      • Batch
      • ClusteringKeyAttribute
      • ColumnAttribute
      • CompactStorageAttribute
      • CounterAttribute
      • CqlArgumentException
      • CqlCommand
      • CqlConditionalCommand<TEntity>
      • CqlDelete
      • CqlFunction
      • CqlInsert<TEntity>
      • CqlLinqNotSupportedException
      • CqlOperator
      • CqlQueryBase<TEntity>
      • CqlQueryExtensions
      • CqlQuerySingleElement<TEntity>
      • CqlQuery<TEntity>
      • CqlScalar<TEntity>
      • CqlToken
      • CqlUpdate
      • ITable
      • IgnoreAttribute
      • PartitionKeyAttribute
      • SecondaryIndexAttribute
      • SessionExtensions
      • StaticColumnAttribute
      • TableAttribute
      • TableType
      • Table<TEntity>
    • Cassandra.DataStax.Auth
      • DseGssapiAuthProvider
      • DsePlainTextAuthProvider
    • Cassandra.DataStax.Auth.Sspi
      • SspiException
    • Cassandra.DataStax.Graph
      • Direction
      • Edge
      • Element
      • ElementMap
      • EnumWrapper
      • FluentGraphStatement
      • GraphNode
      • GraphOptions
      • GraphResultSet
      • GraphStatement
      • IEdge
      • IElement
      • IGraphNode
      • IGraphStatement
      • IPath
      • IProperty
      • IPropertyWithElement
      • IVertex
      • IVertexProperty
      • Path
      • SimpleGraphStatement
      • TEnum
      • Traverser
      • Vertex
    • Cassandra.DataStax.Graph.Internal
      • IGraphSONDeserializer
      • IGraphSONReader
      • IGraphSONSerializer
      • IGraphSONWriter
    • Cassandra.DataStax.Search
      • DateRange
      • DateRangeBound
      • DateRangePrecision
    • Cassandra.Geometry
      • GeometryBase
      • LineString
      • Point
      • Polygon
    • Cassandra.Mapping
      • AppliedInfo<T>
      • ColumnMap
      • Cql
      • CqlQueryOptions
      • IColumnDefinition
      • ICqlBatch
      • ICqlQueryAsyncClient
      • ICqlQueryClient
      • ICqlWriteAsyncClient
      • ICqlWriteClient
      • IMapper
      • IPage<T>
      • ITypeDefinition
      • Map<TPoco>
      • Mapper
      • MappingConfiguration
      • Mappings
      • PrimaryKeyAttribute
      • SortOrder
      • TableNameAttribute
    • Cassandra.Mapping.Attributes
      • ClusteringKeyAttribute
      • ColumnAttribute
      • CounterAttribute
      • FrozenAttribute
      • FrozenKeyAttribute
      • FrozenValueAttribute
      • IgnoreAttribute
      • PartitionKeyAttribute
      • SecondaryIndexAttribute
      • StaticColumnAttribute
      • TableAttribute
    • Cassandra.Mapping.TypeConversion
      • DefaultTypeConverter
      • EnumStringMapper<T>
      • NullableEnumStringMapper<T>
      • TypeConverter
    • Cassandra.Mapping.Utils
      • MemberInfoExtensions
    • Cassandra.Metrics
      • DriverMetricsOptions
      • IDriverMetrics
      • IMetric
      • IMetricsRegistry<TMetric>
      • NodeMetric
      • NodeMetric.Counters
      • NodeMetric.Gauges
      • NodeMetric.Meters
      • NodeMetric.Timers
      • SessionMetric
      • SessionMetric.Counters
      • SessionMetric.Gauges
      • SessionMetric.Meters
      • SessionMetric.Timers
    • Cassandra.Metrics.Abstractions
      • IDriverCounter
      • IDriverGauge
      • IDriverMeter
      • IDriverMetric
      • IDriverMetricsProvider
      • IDriverTimer
    • Cassandra.OpenTelemetry
      • BuilderExtensions
      • CassandraActivitySourceHelper
      • CassandraInstrumentationOptions
      • OpenTelemetryRequestTracker
    • Cassandra.Serialization
      • CustomTypeSerializer<T>
      • TypeSerializer
      • TypeSerializerDefinitions
      • TypeSerializer<T>
      • UdtSerializer
    • Cassandra.Serialization.Primitive
      • DecimalSerializer

    Class MetricsExtensions

    Extension methods to integrate App.Metrics with the DataStax C# Driver.

    Inheritance
    object
    MetricsExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Cassandra
    Assembly: Cassandra.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
    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
    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
    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
    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
    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
    ArgumentException

    If the timer was not created by the AppMetrics provider (CreateDriverMetricsProvider(IMetricsRoot)).

    Back to top © DataStax, All rights reserved.