metrics

package
Version: v1.28.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Counter = iota
	Timer
	Gauge
)

MetricTypes which are supported

View Source
const (
	OperationTagName     = "operation"
	DestinationTagName   = "destination"
	ConsumerGroupTagName = "consumerGroup"
	HostnameTagName      = "hostname"
)

Common tags for all services

View Source
const (
	RestartCount         = "restarts"
	NumGoRoutinesGauge   = "num-goroutines"
	GoMaxProcsGauge      = "gomaxprocs"
	MemoryAllocatedGauge = "memory.allocated"
	MemoryHeapGauge      = "memory.heap"
	MemoryHeapIdleGauge  = "memory.heapidle"
	MemoryHeapInuseGauge = "memory.heapinuse"
	MemoryStackGauge     = "memory.stack"
	NumGCCounter         = "memory.num-gc"
	GcPauseMsTimer       = "memory.gc-pause-ms"
)

Common service base metrics

View Source
const (

	// MetadataListEntityOpsScope defines scope for an operation on metadata
	MetadataListEntityOpsScope = iota
	// MetadataHostAddrToUUIDScope defines scope for an operation on metadata
	MetadataHostAddrToUUIDScope
	// MetadataListAllConsumerGroupsScope defines scope for an operation on metadata
	MetadataListAllConsumerGroupsScope
	// MetadataListConsumerGroupsScope defines scope for an operation on metadata
	MetadataListConsumerGroupsScope
	// MetadataListConsumerGroupsUUIDScope defines scope for an operation on metadata
	MetadataListConsumerGroupsUUIDScope
	// MetadataListDestinationsScope defines scope for an operation on metadata
	MetadataListDestinationsScope
	// MetadataListDestinationsByUUIDScope defines scope for an operation on metadata
	MetadataListDestinationsByUUIDScope
	// MetadataListDestinationExtentsScope defines the scope for an operation on metadata
	MetadataListDestinationExtentsScope
	// MetadataListExtentsStatsScope defines scope for an operation on metadata
	MetadataListExtentsStatsScope
	// MetadataListHostsScope defines scope for an operation on metadata
	MetadataListHostsScope
	// MetadataListInputHostExtentsStatsScope defines scope for an operation on metadata
	MetadataListInputHostExtentsStatsScope
	// MetadataListStoreExtentsStatsScope defines scope for an operation on metadata
	MetadataListStoreExtentsStatsScope
	// MetadataReadConsumerGroupScope defines scope for an operation on metadata
	MetadataReadConsumerGroupScope
	// MetadataReadConsumerGroupByUUIDScope defines scope for an operation on metadata
	MetadataReadConsumerGroupByUUIDScope
	// MetadataReadConsumerGroupExtentScope defines scope for an operation on metadata
	MetadataReadConsumerGroupExtentScope
	// MetadataReadConsumerGroupExtentsScope defines scope for an operation on metadata
	MetadataReadConsumerGroupExtentsScope
	// MetadataReadConsumerGroupExtentsLiteScope defines scope for an operation on metadata
	MetadataReadConsumerGroupExtentsLiteScope
	// MetadataReadConsumerGroupExtentsByExtUUIDScope defines scope for an operation on metadata
	MetadataReadConsumerGroupExtentsByExtUUIDScope
	// MetadataReadDestinationScope defines scope for an operation on metadata
	MetadataReadDestinationScope
	// MetadataReadExtentStatsScope defines scope for an operation on metadata
	MetadataReadExtentStatsScope
	// MetadataUUIDToHostAddrScope defines scope for an operation on metadata
	MetadataUUIDToHostAddrScope
	// MetadataUpdateServiceConfigScope defines scope for an operation on metadata
	MetadataUpdateServiceConfigScope
	// MetadataCreateConsumerGroupScope defines scope for an operation on metadata
	MetadataCreateConsumerGroupScope
	// MetadataCreateConsumerGroupUUIDScope defines scope for an operation on metadata
	MetadataCreateConsumerGroupUUIDScope
	// MetadataCreateConsumerGroupExtentScope defines scope for an operation on metadata
	MetadataCreateConsumerGroupExtentScope
	// MetadataCreateDestinationScope defines scope for an operation on metadata
	MetadataCreateDestinationScope
	// MetadataCreateDestinationUUIDScope defines scope for an operation on metadata
	MetadataCreateDestinationUUIDScope
	// MetadataCreateExtentScope defines scope for an operation on metadata
	MetadataCreateExtentScope
	// MetadataCreateHostInfoScope defines scope for an operation on metadata
	MetadataCreateHostInfoScope
	// MetadataCreateServiceConfigScope defines scope for an operation on metadata
	MetadataCreateServiceConfigScope
	// MetadataDeleteConsumerGroupScope defines scope for an operation on metadata
	MetadataDeleteConsumerGroupScope
	// MetadataDeleteConsumerGroupUUIDScope defines scope for an operation on metadata
	MetadataDeleteConsumerGroupUUIDScope
	// MetadataDeleteDestinationScope defines scope for an operation on metadata
	MetadataDeleteDestinationScope
	// MetadataDeleteDestinationUUIDScope defines scope for an operation on metadata
	MetadataDeleteDestinationUUIDScope
	// MetadataDeleteHostInfoScope defines scope for an operation on metadata
	MetadataDeleteHostInfoScope
	// MetadataDeleteServiceConfigScope defines scope for an operation on metadata
	MetadataDeleteServiceConfigScope
	// MetadataMoveExtentScope defines scope for an operation on metadata
	MetadataMoveExtentScope
	// MetadataReadHostInfoScope defines scope for an operation on metadata
	MetadataReadHostInfoScope
	// MetadataReadServiceConfigScope defines scope for an operation on metadata
	MetadataReadServiceConfigScope
	// MetadataReadStoreExtentReplicaStatsScope defines scope for an operation on metadata
	MetadataReadStoreExtentReplicaStatsScope
	// MetadataRegisterHostUUIDScope defines scope for an operation on metadata
	MetadataRegisterHostUUIDScope
	// MetadataSealExtentScope defines scope for an operation on metadata
	MetadataSealExtentScope
	// MetadataSetAckOffsetScope defines scope for an operation on metadata
	MetadataSetAckOffsetScope
	// MetadataSetOutputHostScope defines scope for an operation on metadata
	MetadataSetOutputHostScope
	// MetadataUpdateConsumerGroupScope defines scope for an operation on metadata
	MetadataUpdateConsumerGroupScope
	// MetadataUpdateConsumerGroupExtentStatusScope defines scope for an operation on metadata
	MetadataUpdateConsumerGroupExtentStatusScope
	// MetadataUpdateDestinationScope defines scope for an operation on metadata
	MetadataUpdateDestinationScope
	// MetadataUpdateDestinationDLQCursorsScope defines scope for an operation on metadata
	MetadataUpdateDestinationDLQCursorsScope
	// MetadataUpdateExtentReplicaStatsScope defines scope for an operation on metadata
	MetadataUpdateExtentReplicaStatsScope
	// MetadataUpdateExtentStatsScope defines scope for an operation on metadata
	MetadataUpdateExtentStatsScope
	// MetadataUpdateHostInfoScope defines scope for an operation on metadata
	MetadataUpdateHostInfoScope
	// MetadataUpdateStoreExtentReplicaStatsScope defines scope for an operation on metadata
	MetadataUpdateStoreExtentReplicaStatsScope

	// -- Operation scopes for ZoneFailoverManager (common) --
	ZoneFailoverMgrScope

	// OpenPublisherStreamScope  represents  OpenPublisherStream API
	OpenPublisherStreamScope
	// DestinationsUpdatedScope represents DestinationsUpdated API
	DestinationsUpdatedScope
	// PubConnectionStreamScope  represents Streaming Message received by inputhost
	PubConnectionStreamScope
	// PutMessageBatchInputHostScope represents PutMessageBatch API
	PutMessageBatchInputHostScope
	//PubConnectionScope  represents Streaming Message received by inputhost
	PubConnectionScope
	//ReplicaConnectionScope represents inputhost's replica connection stream
	ReplicaConnectionScope
	//PutMessageBatchInputHostDestScope represent API PutMessageBatch for per destination
	PutMessageBatchInputHostDestScope
	// UnloadDestinationsScope represents UnloadDestinations API
	UnloadDestinationsScope
	// ListLoadedDestinationsScope represents ListLoadedDestinations API
	ListLoadedDestinationsScope
	// ReadDestStateScope represents ReadDestState API
	ReadDestStateScope
	// DrainExtentsScope represents DrainExtentsScope API
	DrainExtentsScope

	//OpenConsumerStreamScope  represents  OpenConsumerStream API
	OpenConsumerStreamScope
	//AckMessagesScope represents AckMessages API
	AckMessagesScope
	// ConsumerGroupsUpdatedScope represents ConsumerGroupsUpdated API
	ConsumerGroupsUpdatedScope
	// ConsConnectionStreamScope  represents  Streamming Message sent by outputhost
	ConsConnectionStreamScope
	// ReceiveMessageBatchOutputHostScope represents ReceiveMessageBatch API
	ReceiveMessageBatchOutputHostScope
	// UnloadConsumerGroupsScope represents UnloadConsumerGroups API
	UnloadConsumerGroupsScope
	// ConsConnectionScope  represents  Streamming Message sent by outputhost
	ConsConnectionScope
	// ReceiveMessageBatchOutputHostCGScope represents API ReceiveMessageBatch for per destination
	ReceiveMessageBatchOutputHostCGScope

	// GetInputHostsScope represents GetInputHost API
	GetInputHostsScope
	// GetOutputHostsScope represents GetOutputHost API
	GetOutputHostsScope
	// ReportNodeMetricScope represents ReportNodeMetric API
	ReportNodeMetricScope
	// ReportDestinationMetricScope represents ReportDestinationMetric API
	ReportDestinationMetricScope
	// ReportDestinationExtentMetricScope represents ReportDestinationMetric API
	ReportDestinationExtentMetricScope
	// ReportConsumerGroupMetricScope represents ReportConsumerGroupMetric API
	ReportConsumerGroupMetricScope
	// ReportConsumerGroupExtentMetricScope represents ReportConsumerGroupExtentMetric API
	ReportConsumerGroupExtentMetricScope
	// ReportStoreExtentMetricScope represents ReportStoreExtentMetric API
	ReportStoreExtentMetricScope
	// RefreshInputHostsForDstScope represents the internal
	// API for handling GetInputHosts
	RefreshInputHostsForDstScope
	// RefreshOutputHostsForConsGroupScope represents the internal
	// API for handling GetOutputHosts
	RefreshOutputHostsForConsGroupScope
	// EventPipelineScope represents the EventPipeline operation
	EventPipelineScope
	// ExtentsUnreachableScope represents ExtentsUnreachable API
	ExtentsUnreachableScope
	// ExtentCreatedEventScope represents ExtentCreatedEvent
	ExtentCreatedEventScope
	// ConsGroupUpdatedEventScope represents event handler
	ConsGroupUpdatedEventScope
	// ExtentDownEventScope represents event handler
	ExtentDownEventScope
	// InputNotifyEventScope represents event handler
	InputNotifyEventScope
	// OutputNotifyEventScope represents event handler
	OutputNotifyEventScope
	// InputFailedEventScope represents event handler
	InputFailedEventScope
	// StoreFailedEventScope represents event handler
	StoreFailedEventScope
	// RemoteExtentPrimaryStoreDownEventScope represents event handler
	RemoteExtentPrimaryStoreDownEventScope
	// StoreExtentStatusOutOfSyncEventScope represents an event handler
	StoreExtentStatusOutOfSyncEventScope
	// StartReplicationForRemoteZoneExtentScope represents event handler
	StartReplicationForRemoteZoneExtentScope
	// ExtentMonitorScope represents the extent monitor daemon
	ExtentMonitorScope
	// RetentionMgrScope represents the retention manager
	RetentionMgrScope
	// DLQOperationScope represents the dlqMonitor
	DLQOperationScope
	// ControllerCreateDestinationScope represents controller CreateDestination API
	ControllerCreateDestinationScope
	// ControllerUpdateDestinationScope represents controller UpdateDestination API
	ControllerUpdateDestinationScope
	// ControllerDeleteDestinationScope represents controller DeleteDestination API
	ControllerDeleteDestinationScope
	// ControllerCreateConsumerGroupScope represents controller CreateConsumerGroup API
	ControllerCreateConsumerGroupScope
	// ControllerUpdateConsumerGroupScope represents controller UpdateConsumerGroup API
	ControllerUpdateConsumerGroupScope
	// ControllerDeleteConsumerGroupScope represents controller DeleteConsumerGroup API
	ControllerDeleteConsumerGroupScope
	// ControllerCreateRemoteZoneExtentScope represents controller CreateRemoteZoneExtent API
	ControllerCreateRemoteZoneExtentScope
	// ControllerCreateRemoteZoneCgExtentScope represents controller CreateRemoteZoneConsumerGroupExtent API
	ControllerCreateRemoteZoneCgExtentScope
	// QueueDepthBacklogCGScope represents metrics within queuedepth per consumer group
	QueueDepthBacklogCGScope

	// CreateDestinationScope  represents CreateDestination API in frontend
	CreateDestinationScope
	// ReadDestinationScope represents ReadDestination API in frontend
	ReadDestinationScope
	// UpdateDestinationScope represents  UpdateDestination API in frontend
	UpdateDestinationScope
	// DeleteDestinationScope represents DeleteDestination API in frontend
	DeleteDestinationScope
	// ListDestinationsScope ListDestinations API in frontend
	ListDestinationsScope

	// CreateConsumerGroupScope represents CreateConsumerGroup API in frontend
	CreateConsumerGroupScope
	// ReadConsumerGroupScope represents ReadConsumerGroup API in frontend
	ReadConsumerGroupScope
	// UpdateConsumerGroupScope represents UpdateConsumerGroup API in frontend
	UpdateConsumerGroupScope
	// DeleteConsumerGroupScope represents DeleteConsumerGroup API in frontend
	DeleteConsumerGroupScope
	// ListConsumerGroupsScope represents ListConsumerGroups API in frontend
	ListConsumerGroupsScope

	// ReadDestinationHostsScope represents ReadDestinationHosts API in frontend
	ReadDestinationHostsScope
	// ReadConsumerGroupHostsScope represents ReadConsumerGroupHosts API in frontend
	ReadConsumerGroupHostsScope
	// PutMessageBatchScope represents PutMessageBatch API in frontend
	PutMessageBatchScope
	// ReceiveMessageBatchScope  represents ReseiveMessageBatch API in frontend
	ReceiveMessageBatchScope
	// CompleteMessageBatchScope represents CompleteMessageBatch API in frontend
	CompleteMessageBatchScope

	// PurgeDLQForConsumerGroupScope represents PurgeDLQForConsumerGroup API in frontend
	PurgeDLQForConsumerGroupScope
	// MergeDLQForConsumerGroupScope represents MergeDLQForConsumerGroup API in frontend
	MergeDLQForConsumerGroupScope
	// GetQueueDepthInfoScope
	GetQueueDepthInfoScope

	// OpenAppendStreamScope  represents  OpenAppendStream API
	OpenAppendStreamScope
	// OpenReadStreamScope  represents  OpenReadStream API
	OpenReadStreamScope
	// GetAddressFromTimestampScope  represents StGetAddressFromTimestamp API
	GetAddressFromTimestampScope
	// GetExtentInfoScope  represents GetExtentInfo API
	GetExtentInfoScope
	// SealExtentScope  represents SealExtent API
	SealExtentScope
	// PurgeMessagesScope represents PurgeMessagesScope API
	PurgeMessagesScope
	// InConnScope represents related metrics for inConn in storage
	InConnScope
	// OutConnScope represents related metrics for OutConn in storage
	OutConnScope
	// ExtentManagerScope represents related metrics for ExtentManager in storage
	ExtentManagerScope
	// SystemResourceScope represenets related metrics for system resource in storage
	SystemResourceScope
	// ReplicateExtentScope represents related metrics for ReplicateExtent API
	ReplicateExtentScope
	// ListExtentsScope represents metrics for ListExtents API
	ListExtentsScope

	// OpenReplicationRemoteReadScope represents OpenReplicationRemoteRead API
	OpenReplicationRemoteReadScope
	// OpenReplicationReadScope represents OpenReplicationRead API
	OpenReplicationReadScope
	// OpenReplicationRemoteReadPerDestScope represents OpenReplicationRemoteRead API (per destination)
	OpenReplicationRemoteReadPerDestScope
	// OpenReplicationReadPerDestScope represents OpenReplicationRead API (per destination)
	OpenReplicationReadPerDestScope
	// ReplicatorCreateDestUUIDScope represents replicator CreateDestinationUUID API
	ReplicatorCreateDestUUIDScope
	// ReplicatorCreateRmtDestUUIDScope represents replicator CreateRemoteDestinationUUID API
	ReplicatorCreateRmtDestUUIDScope
	// ReplicatorUpdateDestScope represents replicator UpdateDestination API
	ReplicatorUpdateDestScope
	// ReplicatorUpdateRmtDestScope represents replicator UpdateRemoteDestination API
	ReplicatorUpdateRmtDestScope
	// ReplicatorDeleteDestScope represents replicator DeleteDestination API
	ReplicatorDeleteDestScope
	// ReplicatorDeleteRmtDestScope represents replicator DeleteRemoteDestination API
	ReplicatorDeleteRmtDestScope
	// ReplicatorCreateCgUUIDScope represents replicator CreateConsumerGroupUUID API
	ReplicatorCreateCgUUIDScope
	// ReplicatorCreateRmtCgUUIDScope represents replicator CreateRemoteConsumerGroupUUID API
	ReplicatorCreateRmtCgUUIDScope
	// ReplicatorUpdateCgScope represents replicator UpdateConsumerGroup API
	ReplicatorUpdateCgScope
	// ReplicatorUpdateRmtCgScope represents replicator UpdateRemoteConsumerGroup API
	ReplicatorUpdateRmtCgScope
	// ReplicatorDeleteCgScope represents replicator DeleteConsumerGroup API
	ReplicatorDeleteCgScope
	// ReplicatorDeleteRmtCgScope represents replicator DeleteRemoteConsumerGroup API
	ReplicatorDeleteRmtCgScope
	// ReplicatorCreateExtentScope represents replicator CreateExtent API
	ReplicatorCreateExtentScope
	// ReplicatorCreateRmtExtentScope represents replicator CreateRemoteExtent API
	ReplicatorCreateRmtExtentScope
	// ReplicatorCreateCgExtentScope represents replicator CreateConsumerGroupExtent API
	ReplicatorCreateCgExtentScope
	// ReplicatorCreateRmtCgExtentScope represents replicator CreateRemoteConsumerGroupExtent API
	ReplicatorCreateRmtCgExtentScope
	// ReplicatorSetAckOffsetScope represents replicator SetAckOffset API
	ReplicatorSetAckOffsetScope
	// ReplicatorSetAckOffsetInRemoteScope represents replicator SetAckOffsetInRemote API
	ReplicatorSetAckOffsetInRemoteScope
	// ReplicatorReadDestinationInRemoteZoneScope represents replicator ReadDestinationInRemoteZone API
	ReplicatorReadDestinationInRemoteZoneScope
	// ReplicatorReadCgInRemoteZoneScope represents replicator ReadConsumerGroupInRemoteZone API
	ReplicatorReadCgInRemoteZoneScope
	// ReplicatorHostUpdaterScope represents the host updater scope
	ReplicatorHostUpdaterScope
	// ReplicatorReconcileScope represents replicator's reconcile process
	ReplicatorReconcileScope
)

Scope enum

View Source
const (

	// MetadataRequests is the count of requests to metadata
	MetadataRequests = iota
	// MetadataFailures is the count of requests to metadata that have failed
	MetadataFailures
	// MetadataLatency is the latency of requests to metadata
	MetadataLatency

	// ZoneFailoverMgrRunSuccess indicates a success run
	ZoneFailoverMgrRunSuccess
	// ZoneFailoverMgrRunFailToDetectActiveZone indicates failure to detect active zone
	ZoneFailoverMgrRunFailToDetectActiveZone
	// ZoneFailoverMgrRunFailToWriteMetadata indicates failure to write metadata
	ZoneFailoverMgrRunFailToWriteMetadata
	// ZoneFailoverMgrRunFailToWriteMetadata indicates a failed run
	ZoneFailoverMgrRunFailure

	// InputhostRequests indicates the request count for inputhost
	InputhostRequests
	// InputhostFailures indicates failure count for inputhost
	InputhostFailures
	// InputhostMessageReceived records the count of messages received
	InputhostMessageReceived
	// InputhostMessageFailures records the count of messages received failures
	InputhostMessageFailures
	//InputhostReconfClientRequests indicates the request count for reconfige clients
	InputhostReconfClientRequests
	//InputhostMessageLimitThrottled indicates the request has been throttled due to our rate limit
	InputhostMessageLimitThrottled
	//InputhostMessageChannelFullThrottled indicates the request has been throttled due to the channel being full
	InputhostMessageChannelFullThrottled
	// InputhostUserFailures indicates this is a user failure (~HTTP 4xx)
	InputhostUserFailures
	// InputhostInternalFailures indicates this is an internal failure (HTTP 5xx)
	InputhostInternalFailures
	// InputhostMessageUserFailures records the count of messages received failures
	InputhostMessageUserFailures
	// InputhostMessageInternalFailures records the count of messages received failures
	InputhostMessageInternalFailures
	// InputhostGauges is the gauges for inputhost
	InputhostGauges
	// InputhostPubConnection is the gauges for active pubconnection
	InputhostPubConnection
	// InputhostLatencyTimer represents time taken by an operation
	InputhostLatencyTimer
	// InputhostWriteMessageLatency is the latency from receiving a message from stream to returning ack back to stream
	InputhostWriteMessageLatency
	// InputhostWriteMessageBeforeAckLatency is the latency from receiving a message from stream to getting ack from replicas
	// the only difference with InputhostWriteMessageLatency is this metrics excludes the latency for writing ack back to the stream
	InputhostWriteMessageBeforeAckLatency
	// InputhostDestMessageReceived  indicates prefix name for destinations request counter
	// append the destination path will be the actual name for the counter.
	// each destination has a unique name tag
	InputhostDestMessageReceived
	// InputhostDestMessageFailures indicates prefix nmae of destinations failure counter
	// append the destination path will be the actual name for the counter.
	// each destination has a unique name tag
	InputhostDestMessageFailures
	// InputhostDestMessageLimitThrottled is used to indicate that this particular destination
	// is throttled due to token bucket rate limit
	InputhostDestMessageLimitThrottled
	// InputhostDestMessageChannelFullThrottled is used to indicate that this particular destination
	// is throttled due to the channel being full
	InputhostDestMessageChannelFullThrottled
	// InputhostDestMessageUserFailures indicates prefix nmae of destinations failure counter
	// append the destination path will be the actual name for the counter.
	// each destination has a unique name tag
	InputhostDestMessageUserFailures
	// InputhostDestMessageInternalFailures indicates prefix nmae of destinations failure counter
	// append the destination path will be the actual name for the counter.
	// each destination has a unique name tag
	InputhostDestMessageInternalFailures
	// InputhostDestWriteMessageLatency is the latency from receiving a message from stream to returning ack back to stream
	InputhostDestWriteMessageLatency
	// InputhostDestWriteMessageBeforeAckLatency is the latency from receiving a message from stream to getting ack from replicas
	// the only difference with InputhostDestWriteMessageLatency is this metrics excludes the latency for returning ack back to the stream
	InputhostDestWriteMessageBeforeAckLatency
	// InputhostDestPubConnection is the gauge of active connections per destination
	InputhostDestPubConnection
	// InputhostMessageReceivedBytes tracks the total incoming messages in bytes
	InputhostDestMessageReceivedBytes
	// InputhostMessageSentBytes tracks the total outgoing messages (to replica) in bytes
	InputhostDestMessageSentBytes

	// OutputhostRequests indicates the request count for outputhost
	OutputhostRequests
	// OutputhostFailures indicates failure count for outputhost
	OutputhostFailures
	// OutputhostLongPollingTimeOut indicates time out for long polling
	OutputhostLongPollingTimeOut
	// OutputhostReceiveMsgBatchWriteToMsgCacheTimeout indicates time out for ReceiveMsgBatch to write to msg cache
	OutputhostReceiveMsgBatchWriteToMsgCacheTimeout
	// OutputhostMessageSent records the count of messages sent
	OutputhostMessageSent
	// OutputhostMessageFailures records the count of messages sent failures
	OutputhostMessageFailures
	// OutputhostCreditsReceived indicates the count of the credits
	OutputhostCreditsReceived
	// OutputhostDLQMessageRequests records the count of DLQ messages requests
	OutputhostDLQMessageRequests
	// OutputhostDLQMessageFailures records the count of DLQ messages sent failures
	OutputhostDLQMessageFailures
	// OutputhostMessageRedelivered records the count of messages redeliverd
	OutputhostMessageRedelivered
	// OutputhostMessageSentAck records the count of ack messages
	OutputhostMessageSentAck
	// OutputhostMessageSentNAck records the count of nack messages
	OutputhostMessageSentNAck
	//OutputhostMessageAckFailures recores the count of messages ack failures
	OutputhostMessageAckFailures
	//OutputhostMessageNackFailures recores the count of messages nack failures
	OutputhostMessageNackFailures
	// OutputhostMessageNoAckManager records the count of acks which came where there was no Ack Manager
	OutputhostMessageNoAckManager
	// OutputhostMessageDiffSession records the count of acks which came for a different session
	OutputhostMessageDiffSession
	// OutputhostMessageAckManagerError records the count of errors from the ack manager
	OutputhostMessageAckManagerError
	// OutputhostUserFailures indicates this is a user failure (~HTTP 4xx)
	OutputhostUserFailures
	// OutputhostInternalFailures indicates this is an internal failure (HTTP 5xx)
	OutputhostInternalFailures
	// OutputhostConsConnection is the number of active connections
	OutputhostConsConnection
	// OutputhostCreditsAccumulated is a gauge to record credits that are accumulated locally
	OutputhostCreditsAccumulated
	// OutputhostLatencyTimer represents time taken by an operation
	OutputhostLatencyTimer
	// OutputhostCGMessageSent records the count of messages sent per consumer group
	OutputhostCGMessageSent
	// OutputhostCGMessageSentBytes records the total size of messages sent per consumer-group
	OutputhostCGMessageSentBytes
	// OutputhostCGMessageReceivedBytes records the total size of message received from replica per CG
	OutputhostCGMessageReceivedBytes
	// OutputhostCGMessageFailures records the count of messages sent failures per consumer group
	OutputhostCGMessageFailures
	// OutputhostCGCreditsReceived indicates the count of the credits per consumer group
	OutputhostCGCreditsReceived
	// OutputhostCGDLQMessageRequests records the count of DLQ messages requests per consumer group
	OutputhostCGDLQMessageRequests
	// OutputhostCGDLQMessageFailures records the count of DLQ messages sent failures per consumer group
	OutputhostCGDLQMessageFailures
	// OutputhostCGMessageRedelivered records the count of messages redelivered
	OutputhostCGMessageRedelivered
	// OutputhostCGMessageSentAck records the count of ack messages
	OutputhostCGMessageSentAck
	// OutputhostCGMessageSentNAck records the count of nack messages
	OutputhostCGMessageSentNAck
	// OutputhostCGMessagesThrottled records the count of messages throttled
	OutputhostCGMessagesThrottled
	// OutputhostCGAckMgrSeqNotFound is the gauge to track acks whose seq number is not found
	OutputhostCGAckMgrSeqNotFound
	// OutputhostCGReplicaReconnect is a counter that tracks replica reconnections
	OutputhostCGReplicaReconnect
	// OutputhostCGMessageSentLatency is the latency to send a message
	OutputhostCGMessageSentLatency
	//OutputhostCGMessageCacheSize is the cashe size of consumer group message
	OutputhostCGMessageCacheSize
	// OutputhostCGConsConnection is the number of active connections per consumer group
	OutputhostCGConsConnection
	// OutputhostCGOutstandingDeliveries is the number of outstanding messages for a single consumer group
	OutputhostCGOutstandingDeliveries
	// OutputhostCGHealthState is the most recent health state for the consumer group
	OutputhostCGHealthState
	// OutputhostCGNumExtents is the number of active extents for this CG
	OutputhostCGNumExtents
	// OutputhostCGAckMgrSize is a gauge for the size of the ack manager
	OutputhostCGAckMgrSize
	// OutputhostCGAckMgrLevelUpdate is a gauge to track the last time ack level moved
	OutputhostCGAckMgrLevelUpdate
	// OutputhostCGAckMgrConsumed is a gauge for the extents marked as consumed
	OutputhostCGAckMgrConsumed
	// OutputhostCGAckMgrResetMsg is the gauge to track the resets to the ackMgrMap
	OutputhostCGAckMgrResetMsg
	// OutputhostCGAckMgrResetMsgError is the gauge to track errors on reset to the ackMgrMap
	OutputhostCGAckMgrResetMsgError
	// OutputhostCGSkippedMessages is the gauge to track skipped messages
	OutputhostCGSkippedMessages
	// OutputhostCGCreditsAccumulated is a gauge to record credits that are accumulated locally per consumer group
	OutputhostCGCreditsAccumulated
	// OutputhostCGKafkaIncomingBytes corresponds to Kafka's (sarama's) incoming-byte-rate metric
	OutputhostCGKafkaIncomingBytes
	// OutputhostCGKafkaOutgoingBytes corresponds to Kafka's (sarama's) outgoing-byte-rate metric
	OutputhostCGKafkaOutgoingBytes
	// OutputhostCGKafkaRequestSent corresponds to Kafka's (sarama's) request-rate metric
	OutputhostCGKafkaRequestSent
	// OutputhostCGKafkaRequestSize corresponds to Kafka's (sarama's) request-size metric
	OutputhostCGKafkaRequestSize
	// OutputhostCGKafkaRequestLatency corresponds to Kafka's (sarama's) request-latency metric
	OutputhostCGKafkaRequestLatency
	// OutputhostCGKafkaResponseReceived corresponds to Kafka's (sarama's) response-rate metric
	OutputhostCGKafkaResponseReceived
	// OutputhostCGKafkaResponseSize corresponds to Kafka's (sarama's) response-size metric
	OutputhostCGKafkaResponseSize

	// FrontendRequests indicates the request count for frontend
	FrontendRequests
	// FrontendFailures indicates failure count for frontend
	FrontendFailures
	// FrontendEntityNotExist indicates entityNotExist Error for frontend
	FrontendEntityNotExist
	// FrontendUserFailures indicates this is a user failure (~HTTP 4xx)
	FrontendUserFailures
	// FrontendInternalFailures indicates this is an internal failure (HTTP 5xx)
	FrontendInternalFailures
	// FrontendLatencyTimer represents time taken by an operation
	FrontendLatencyTimer

	// StorageRequests is the count of requests
	StorageRequests
	// StorageFailures is the count of requests that have failed
	StorageFailures
	// StorageStoreFailures is the count of requests that have failed due to storage errors
	StorageStoreFailures
	// StorageMessageReceived records the count of messages received
	StorageMessageReceived
	// StorageMessageSent records the count of messages sent
	StorageMessageSent
	// WatermarksReceived records the count of fully replicated watermarks received
	WatermarksReceived
	// StorageOpenExtents is the number of active extents
	StorageOpenExtents
	// StorageWriteStreams is the number of active write streams
	StorageWriteStreams
	// StorageReadStreams is the number of active read streams
	StorageReadStreams
	// StorageInMsgChanDepth is the depth of the msg-chan buffer during writes
	StorageInMsgChanDepth
	// StorageInAckChanDepth is the depth of the ack-chan buffer during writes
	StorageInAckChanDepth
	// StorageOutMsgChanDepth is the depth of the msg-chan buffer during reads
	StorageOutMsgChanDepth
	// StorageDiskAvailableSpaceMB is the available disk space in MB
	StorageDiskAvailableSpaceMB
	// StorageDiskAvailableSpacePcnt is the available disk space percentage
	StorageDiskAvailableSpacePcnt

	// StorageLatencyTimer is the latency for every (non-streaming) request
	StorageLatencyTimer
	// StorageWriteStoreLatency is the latency to write message to store
	StorageWriteStoreLatency
	// StorageWriteMessageLatency is the latency from receiving a message from stream(input) to returning ack back to stream
	StorageWriteMessageLatency
	// StorageWriteMessageBeforeAckLatency is the latency from receiving a message from stream(input) to getting ack from store
	// the only difference with StorageWriteMessageLatency is this metrics excludes the latency for returning ack back to the stream
	StorageWriteMessageBeforeAckLatency
	// StorageReadStoreLatency is the latency to read message from store
	StorageReadStoreLatency
	// StorageReadMessageLatency is the latency to read and send out a message
	StorageReadMessageLatency
	// StorageInWriteTChannelLatency is the latency to write ack to tchannel in stream
	StorageInWriteTChannelLatency
	// StorageInFlushTChannelLatency is the latency to flush ack to tchannel in stream
	StorageInFlushTChannelLatency
	// StorageOutWriteTChannelLatency is the latench to write msg to tchannel out stream
	StorageOutWriteTChannelLatency
	// StorageOutFlushTChannelLatency is the latency to flush msg to tchannel out stream
	StorageOutFlushTChannelLatency
	// StorageReplicationJobMaxConsecutiveFailures is the max number of consecutive failures for any replication job
	StorageReplicationJobMaxConsecutiveFailures
	// StorageReplicationJobCurrentFailures is the number of failed job in current run
	StorageReplicationJobCurrentFailures
	// StorageReplicationJobCurrentSuccess is the number of success job in current run
	StorageReplicationJobCurrentSuccess
	// StorageReplicationJobRun indicates the replication job runs
	StorageReplicationJobRun

	// ControllerErrMetadataReadCounter indicates an error from metadata
	ControllerErrMetadataReadCounter
	// ControllerErrMetadataUpdateCounter indicates failure to update metadata
	ControllerErrMetadataUpdateCounter
	// ControllerErrMetadataEntityNotFoundCounter indicates non-existent entity
	ControllerErrMetadataEntityNotFoundCounter
	// ControllerErrTryLockCounter indicates failure to acquire try lock
	ControllerErrTryLockCounter
	// ControllerErrCreateExtentCounter indicates failure to create extent
	ControllerErrCreateExtentCounter
	// ControllerErrPickInHostCounter indicates failure to pick input host for extent
	ControllerErrPickInHostCounter
	// ControllerErrPickOutHostCounter indicates failure to pick output host for extent
	ControllerErrPickOutHostCounter
	// ControllerErrCallReplicatorCounter indicates failure to call replicator
	ControllerErrCallReplicatorCounter

	// ControllerErrPickStoreHostCounter indicates failure to pick store host for extent
	ControllerErrPickStoreHostCounter
	// ControllerErrResolveUUIDCounter indicates failure to resolve UUID to ip:port
	ControllerErrResolveUUIDCounter
	// ControllerErrCreateTChanClientCounter indicates failure to create tchannel client
	ControllerErrCreateTChanClientCounter
	// ControllerErrNoHealthyStoreCounter indicates unavailability of store hosts
	ControllerErrNoHealthyStoreCounter
	// ControllerErrSealFailed indicates failure of seal operation
	ControllerErrSealFailed
	// ControllerErrTooManyOpenCGExtents indicates too many open extents for some CG
	ControllerErrTooManyOpenCGExtents
	// ControllerErrNoRetryWorkers indicates that an event cannot be retried
	// because all of the retry workers are busy
	ControllerErrNoRetryWorkers
	// ControllerErrBadRequestCounter indicates a malformed request
	ControllerErrBadRequestCounter
	// ControllerErrBadEntityCounter indicates either an entity not exists or disabled error
	ControllerErrBadEntityCounter
	// ControllerErrDrainFailed indicates that a drain command issued to input failed
	ControllerErrDrainFailed

	// ControllerEventsDropped indicates an event drop due to queue full
	ControllerEventsDropped
	// ControllerRequests indicates the request count
	ControllerRequests
	// ControllerFailures indicates failure count
	ControllerFailures
	// ControllerRetries represents retry attempts on an operation
	ControllerRetries

	// ControllerRetriesExceeded indicates max retries being exceeded on an operation
	ControllerRetriesExceeded
	//ControllerRateLimited indicates count of the times that throttle kicked in
	ControllerRateLimited

	// ControllerRetentionJobStartCounter indicates the started retention job count
	ControllerRetentionJobStartCounter
	// ControllerRetentionJobFailedCounter indicates the failed retention job count
	ControllerRetentionJobFailedCounter
	// ControllerRetentionJobCompletedCounter indicates the completed retention job count
	ControllerRetentionJobCompletedCounter
	// ControllerRetentionJobCancelledCounter indicates the cancelled retention job count
	ControllerRetentionJobCancelledCounter
	// ControllerGetAddressFailedCounter indicates the failed getAddress calls
	ControllerGetAddressFailedCounter
	// ControllerGetAddressCompletedCounter indicates the completed getAddress calls
	ControllerGetAddressCompletedCounter
	// ControllerPurgeMessagesRequestCounter indicates the purge messages request count
	ControllerPurgeMessagesRequestCounter

	// ControllerLatencyTimer represents time taken by an operation
	ControllerLatencyTimer
	// ControllerRetentionJobDuration is the time spent to finish retention on an extent
	ControllerRetentionJobDuration
	// ControllerGetAddressLatency is the latency of getAddressFromTS
	ControllerGetAddressLatency
	// ControllerPurgeMessagesLatency is the letency of purge messages request
	ControllerPurgeMessagesLatency

	// ControllerCGBacklogAvailable is the numbers for availbale back log
	ControllerCGBacklogAvailable
	// ControllerCGBacklogUnavailable is the numbers for unavailbale back log
	ControllerCGBacklogUnavailable
	// ControllerCGBacklogInflight is the numbers for inflight back log
	ControllerCGBacklogInflight
	// ControllerCGBacklogDLQ is the numbers for DLQ back log
	ControllerCGBacklogDLQ
	// ControllerCGBacklogProgress is an indication of progress made on the backlog
	ControllerCGBacklogProgress
	// ControllerNumOpenExtents represents the count of open extents
	ControllerNumOpenExtents
	// ControllerNumSealedExtents represents the count of sealed extents
	ControllerNumSealedExtents
	// ControllerNumConsumedExtents represents the count of consumed extents
	ControllerNumConsumedExtents
	// ControllerNumOpenDLQExtents represents the count of open dlq extents
	ControllerNumOpenDLQExtents
	// ControllerNumSealedDLQExtents represents the count of sealed dlq extents
	ControllerNumSealedDLQExtents
	// ControllerNumConsumedDLQExtents represents the count of consumed dlq extents
	ControllerNumConsumedDLQExtents
	// ControllerNumOpenCGExtents represents the count of open cg extents
	ControllerNumOpenCGExtents
	// ControllerNumConsumedCGExtents represents the count of consumed cg extents
	ControllerNumConsumedCGExtents
	// ControllerNoActiveZone indicates there's no active zone from dynamic config
	ControllerNoActiveZone

	// ReplicatorCreateInStreamFailure indicates failure when creating in stream
	ReplicatorCreateInStreamFailure
	// ReplicatorCreateOutStreamFailure indicates failure when creating out stream
	ReplicatorCreateOutStreamFailure
	// ReplicatorRequests indicates non-messaging request count for replicator
	ReplicatorRequests
	// ReplicatorFailures indicates non-messaging failure count for replicator
	ReplicatorFailures
	// ReplicatorBadRequest indicates bad request
	ReplicatorBadRequest

	// ReplicatorInConnCreditsReceived indicates how many credits InConn received
	ReplicatorInConnCreditsReceived
	// ReplicatorInConnMsgWritten indicates how many messages InConn writes to client
	ReplicatorInConnMsgWritten
	// ReplicatorInConnPerDestMsgWritten indicates how many messages InConn writes to client per destination
	ReplicatorInConnPerDestMsgWritten
	// ReplicatorInConnPerDestMsgLatency indicates the per destination replication latency
	ReplicatorInConnPerDestMsgLatency
	// ReplicatorOutConnCreditsSent indicates how many credits OutConn sent
	ReplicatorOutConnCreditsSent
	// ReplicatorOutConnMsgRead indicates how many messages OutConn read
	ReplicatorOutConnMsgRead

	// ReplicatorReconcileDestRun indicates the reconcile fails
	ReplicatorReconcileFail
	// ReplicatorReconcileDestRun indicates the reconcile for dest runs
	ReplicatorReconcileDestRun
	// ReplicatorReconcileDestFail indicates the reconcile for dest fails
	ReplicatorReconcileDestFail
	// ReplicatorReconcileDestFoundMissing indicates the reconcile for dest found a missing dest
	ReplicatorReconcileDestFoundMissing
	// ReplicatorReconcileCgRun indicates the reconcile for cg runs
	ReplicatorReconcileCgRun
	// ReplicatorReconcileCgFail indicates the reconcile for cg fails
	ReplicatorReconcileCgFail
	// ReplicatorReconcileCgFoundMissing indicates the reconcile for cg found a missing cg
	ReplicatorReconcileCgFoundMissing
	// ReplicatorReconcileCgFoundUpdated indicates the reconcile for cg found a updated cg
	ReplicatorReconcileCgFoundUpdated
	// ReplicatorReconcileDestExtentRun indicates the reconcile for dest extent runs
	ReplicatorReconcileDestExtentRun
	// ReplicatorReconcileDestExtentFail indicates the reconcile for dest extent fails
	ReplicatorReconcileDestExtentFail
	// ReplicatorReconcileDestExtentFoundMissing indicates the reconcile for dest extent found a missing dest extent
	ReplicatorReconcileDestExtentFoundMissing
	// ReplicatorReconcileDestExtentRemoteConsumedLocalMissing indicates the reconcile for dest extent found a dest extent that is consumed on remote side and local is missing
	ReplicatorReconcileDestExtentRemoteConsumedLocalMissing
	// ReplicatorReconcileDestExtentRemoteDeleted indicates the reconcile for dest extent found a dest extent that is deleted on remote side and local is missing
	ReplicatorReconcileDestExtentRemoteDeletedLocalMissing
	// ReplicatorReconcileDestExtentRemoteDeletedLocalNot indicates the reconcile for dest extent found an inconsistent extent status(remote is deleted, local is not)
	ReplicatorReconcileDestExtentRemoteDeletedLocalNot
	// ReplicatorReconcileDestExtentSuspectMissingExtents indicates the length of the suspect missing extent list
	ReplicatorReconcileDestExtentSuspectMissingExtents
	// ReplicatorReconcileCgExtentRun indicates the reconcile for cg extent runs
	ReplicatorReconcileCgExtentRun
	// ReplicatorReconcileCgExtentFail indicates the reconcile for cg extent fails
	ReplicatorReconcileCgExtentFail
	// ReplicatorReconcileCgExtentFoundMissing indicates the reconcile for cg extent found a missing cg extent
	ReplicatorReconcileCgExtentFoundMissing
	// ReplicatorReconcileCgExtentRemoteConsumedLocalMissing indicates the reconcile for cg extent found a cg extent that is consumed on remote side and local is missing
	ReplicatorReconcileCgExtentRemoteConsumedLocalMissing
	// ReplicatorReconcileCgExtentRemoteDeletedLocalMissing indicates the reconcile for cg extent found a cg extent that is deleted on remote side and local is missing
	ReplicatorReconcileCgExtentRemoteDeletedLocalMissing
	// ReplicatorInvalidHostUpdates indicates an invalid update received for hosts update
	ReplicatorInvalidHostsUpdate
	// ReplicatorHostUpdated indicates a success hosts update
	ReplicatorHostUpdated
)

Metric enum

View Source
const (
	UnknownDirectoryTagValue = "Unknown"
)

This package should hold all the metrics and tags for cherami

Variables

GoRuntimeMetrics represent the runtime stats from go runtime

View Source
var ServiceMetrics = map[MetricName]MetricType{
	RestartCount: Counter,
}

ServiceMetrics are types for common service base metrics

Functions

func RegisterHandler added in v0.2.0

func RegisterHandler(metricName, filterTag, filterTagVal string, handler HandlerFn)

RegisterHandler registers a handler (closure) that receives updates for a particular guage or counter based on the metric name and the name/value of one of the metric's tags. If the filterTag/Val are both empty, all updates to that metric will trigger the handler. If metricName is empty, all metrics matching the tag filter will pass through your function. A nil handler unregisters the handler for the given filter parameters

Dev notes: * It is advisible to defer a call to unregister your handler when your test ends * Your handler can be called concurrently. Capture your own sync.Mutex if you must serialize * Counters report the delta; you must maintain the cumulative value of your counter if it is important * Your handler executes synchronously with the metrics code; DO NOT BLOCK

Types

type Client

type Client interface {
	// IncCounter increments a counter and emits
	// to m3 backend
	IncCounter(scope int, counter int)
	// AddCounter adds delta to the counter and
	// emits to the m3 backend
	AddCounter(scope int, counter int, delta int64)
	// StartTimer starts a timer for the given
	// metric name
	StartTimer(scope int, timer int) Stopwatch
	// RecordTimer starts a timer for the given
	// metric name
	RecordTimer(scope int, timer int, d time.Duration)
	// UpdateGauge reports Gauge type metric to M3
	UpdateGauge(scope int, gauge int, delta int64)
	// GetParentReporter return the parentReporter
	GetParentReporter() Reporter
}

Client is the interface used to report metrics to m3 backend.

func NewClient

func NewClient(reporter Reporter, serviceIdx ServiceIdx) Client

NewClient creates and returns a new instance of Client implementation reporter holds the common tags for the servcie serviceIdx indicates the service type in (InputhostIndex, ... StorageIndex)

func NewClientWithTags

func NewClientWithTags(m3Client Client, serviceIdx ServiceIdx, tags map[string]string) Client

NewClientWithTags creates and returens a new metrics.Client, with the new tags added to scope Use get client only for per destination or per consumer group right now. For other metrics, use NewClient.

type ClientImpl

type ClientImpl struct {
	// contains filtered or unexported fields
}

ClientImpl is for m3 emits within inputhost

func (*ClientImpl) AddCounter

func (m *ClientImpl) AddCounter(scopeIdx int, metricIdx int, delta int64)

AddCounter adds delta to the counter and emits to the m3 backend

func (*ClientImpl) GetParentReporter

func (m *ClientImpl) GetParentReporter() Reporter

GetParentReporter return the parentReporter

func (*ClientImpl) IncCounter

func (m *ClientImpl) IncCounter(scopeIdx int, metricIdx int)

IncCounter increments one for a counter and emits to m3 backend

func (*ClientImpl) RecordTimer

func (m *ClientImpl) RecordTimer(scopeIdx int, metricIdx int, d time.Duration)

RecordTimer record and emit a timer for the given metric name

func (*ClientImpl) StartTimer

func (m *ClientImpl) StartTimer(scopeIdx int, metricIdx int) Stopwatch

StartTimer starts a timer for the given metric name

func (*ClientImpl) UpdateGauge

func (m *ClientImpl) UpdateGauge(scopeIdx int, metricIdx int, delta int64)

UpdateGauge reports Gauge type metric to M3

type ErrorClass

type ErrorClass uint8

ErrorClass is an enum to help with classifying SLA vs. non-SLA errors (SLA = "service level agreement")

const (
	// NoError indicates that there is no error (error should be nil)
	NoError ErrorClass = iota
	// UserError indicates that this is NOT an SLA-reportable error
	UserError
	// InternalError indicates that this is an SLA-reportable error
	InternalError
)

type HandlerFn added in v0.2.0

type HandlerFn func(metricName string, baseTags, tags map[string]string, value int64)

HandlerFn is the handler function prototype for the test reporter; your provided functions must match this type.

type MetricName

type MetricName string

MetricName is the name of the metric

type MetricType

type MetricType int

MetricType is the type of the metric

type Reporter

type Reporter interface {
	// InitMetrics is used to initialize the metrics map
	// with the respective type
	InitMetrics(metricMap map[MetricName]MetricType)

	// GetChildReporter is used to get a child reporter from the parent
	// this also makes sure we have all the tags from the parent in
	// addition to the tags supplied here
	GetChildReporter(tags map[string]string) Reporter

	// GetTags gets the tags for this reporter object
	GetTags() map[string]string

	// IncCounter should be used for Counter style metrics
	IncCounter(name string, tags map[string]string, delta int64)

	// UpdateGauge should be used for Gauge style metrics
	UpdateGauge(name string, tags map[string]string, value int64)

	// StartTimer should be used for measuring latency.
	// this returns a Stopwatch which can be used to stop the timer
	StartTimer(name string, tags map[string]string) Stopwatch

	// RecordTimer should be used for measuring latency when you cannot start the stop watch.
	RecordTimer(name string, tags map[string]string, d time.Duration)
}

Reporter is the the interface used to report stats.

func NewSimpleReporter

func NewSimpleReporter(tags map[string]string) Reporter

NewSimpleReporter create an instance of Reporter which can be used for driver to emit metric to console

func NewStatsdReporter

func NewStatsdReporter(HostPort string, Prefix string, FlushInterval time.Duration, FlushBytes int, tags map[string]string) Reporter

NewStatsdReporter return a report which reports to statsd on the given addr

func NewTestReporter added in v0.2.0

func NewTestReporter(tags map[string]string) Reporter

NewTestReporter create an instance of Reporter which can be used for driver to emit metric to console

type RuntimeMetricsReporter

type RuntimeMetricsReporter struct {
	// contains filtered or unexported fields
}

RuntimeMetricsReporter A struct containing the state of the RuntimeMetricsReporter.

func NewRuntimeMetricsReporter

func NewRuntimeMetricsReporter(reporter Reporter, reportInterval time.Duration, logger bark.Logger) *RuntimeMetricsReporter

NewRuntimeMetricsReporter Creates a new RuntimeMetricsReporter.

func (*RuntimeMetricsReporter) Start

func (r *RuntimeMetricsReporter) Start()

Start Starts the reporter thread that periodically emits metrics.

func (*RuntimeMetricsReporter) Stop

func (r *RuntimeMetricsReporter) Stop()

Stop Stops reporting of runtime metrics. The reporter cannot be started again after it's been stopped.

type ServiceIdx

type ServiceIdx int

ServiceIdx is an index that uniquely identifies the service

const (
	Common ServiceIdx = iota
	Frontend
	Controller
	Inputhost
	Outputhost
	Storage
	Replicator
)

Service names for all services that emit Metrics

type SimpleReporter

type SimpleReporter struct {
	// contains filtered or unexported fields
}

SimpleReporter is the reporter used to dump metric to console for stress runs

func (*SimpleReporter) GetChildReporter

func (r *SimpleReporter) GetChildReporter(tags map[string]string) Reporter

GetChildReporter creates the child reporter for this parent reporter

func (*SimpleReporter) GetTags

func (r *SimpleReporter) GetTags() map[string]string

GetTags returns the tags for this reporter object

func (*SimpleReporter) IncCounter

func (r *SimpleReporter) IncCounter(name string, tags map[string]string, delta int64)

IncCounter reports Counter metric to M3

func (*SimpleReporter) InitMetrics

func (r *SimpleReporter) InitMetrics(metricMap map[MetricName]MetricType)

InitMetrics is used to initialize the metrics map with the respective type

func (*SimpleReporter) RecordTimer

func (r *SimpleReporter) RecordTimer(name string, tags map[string]string, d time.Duration)

RecordTimer should be used for measuring latency when you cannot start the stop watch.

func (*SimpleReporter) StartTimer

func (r *SimpleReporter) StartTimer(name string, tags map[string]string) Stopwatch

StartTimer returns a Stopwatch which when stopped will report the metric to M3

func (*SimpleReporter) UpdateGauge

func (r *SimpleReporter) UpdateGauge(name string, tags map[string]string, value int64)

UpdateGauge reports Gauge type metric

type StatsdReporter

type StatsdReporter struct {
	// contains filtered or unexported fields
}

StatsdReporter is a implementation of Reporter interface with statsd

func (*StatsdReporter) GetChildReporter

func (r *StatsdReporter) GetChildReporter(tags map[string]string) Reporter

GetChildReporter is used to get a child reporter from the parent this also makes sure we have all the tags from the parent in addition to the tags supplied here

func (*StatsdReporter) GetTags

func (r *StatsdReporter) GetTags() map[string]string

GetTags gets the tags for this reporter object

func (*StatsdReporter) IncCounter

func (r *StatsdReporter) IncCounter(name string, tags map[string]string, delta int64)

IncCounter should be used for Counter style metrics

func (*StatsdReporter) InitMetrics

func (r *StatsdReporter) InitMetrics(metricMap map[MetricName]MetricType)

InitMetrics is used to initialize the metrics map with the respective type

func (*StatsdReporter) RecordTimer

func (r *StatsdReporter) RecordTimer(name string, tags map[string]string, d time.Duration)

RecordTimer should be used for measuring latency when you cannot start the stop watch.

func (*StatsdReporter) StartTimer

func (r *StatsdReporter) StartTimer(name string, tags map[string]string) Stopwatch

StartTimer should be used for measuring latency. this returns a Stopwatch which can be used to stop the timer

func (*StatsdReporter) UpdateGauge

func (r *StatsdReporter) UpdateGauge(name string, tags map[string]string, value int64)

UpdateGauge should be used for Gauge style metrics

type StatsdStopwatch

type StatsdStopwatch struct {
	// contains filtered or unexported fields
}

StatsdStopwatch is the struct which implements the Stopwatch interface to start and stop the timer

func (*StatsdStopwatch) Stop

func (s *StatsdStopwatch) Stop() time.Duration

Stop stops the stop watch and records the latency to M3

type Stopwatch

type Stopwatch interface {
	Stop() time.Duration
}

Stopwatch is the interface to stop the timer

type TestReporter added in v0.2.0

type TestReporter struct {
	// contains filtered or unexported fields
}

TestReporter is the reporter used to dump metric to console for stress runs

func (*TestReporter) GetChildReporter added in v0.2.0

func (r *TestReporter) GetChildReporter(tags map[string]string) Reporter

GetChildReporter creates the child reporter for this parent reporter

func (*TestReporter) GetTags added in v0.2.0

func (r *TestReporter) GetTags() map[string]string

GetTags returns the tags for this reporter object

func (*TestReporter) IncCounter added in v0.2.0

func (r *TestReporter) IncCounter(name string, tags map[string]string, delta int64)

IncCounter reports Counter metric to M3

func (*TestReporter) InitMetrics added in v0.2.0

func (r *TestReporter) InitMetrics(metricMap map[MetricName]MetricType)

InitMetrics is used to initialize the metrics map with the respective type

func (*TestReporter) RecordTimer added in v0.2.0

func (r *TestReporter) RecordTimer(name string, tags map[string]string, d time.Duration)

RecordTimer should be used for measuring latency when you cannot start the stop watch.

func (*TestReporter) StartTimer added in v0.2.0

func (r *TestReporter) StartTimer(name string, tags map[string]string) Stopwatch

StartTimer returns a Stopwatch which when stopped will report the metric to M3

func (*TestReporter) UpdateGauge added in v0.2.0

func (r *TestReporter) UpdateGauge(name string, tags map[string]string, value int64)

UpdateGauge reports Gauge type metric

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL