metrics

package
v0.0.0-...-f9f87ea Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Counter = iota
	Timer
	Gauge
)

MetricTypes which are supported

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

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 (

	// MetadataListDestinationsScope represents method within metadatamgr
	MetadataListDestinationsScope = iota
	// MetadataListDestinationsPageScope represents method within metadatamgr
	MetadataListDestinationsPageScope
	// MetadataReadDstScope represents method within metadatamgr
	MetadataReadDstScope
	// MetadataReadExtentStatsScope represents method within metadatamgr
	MetadataReadExtentStatsScope
	// MetadataReadStoreExtentStatsScope represents method within metadatamgr
	MetadataReadStoreExtentStatsScope
	// MetadataReadConsumerGroupExtentScope represents method within metadatamgr
	MetadataReadConsumerGroupExtentScope
	// MetadataListExtentsByDstScope represents method within metadatamgr
	MetadataListExtentsByDstScope
	// MetadataListExtentsByInputScope represents method within metadatamgr
	MetadataListExtentsByInputScope
	// MetadataListExtentsByStoreScope represents method within metadatamgr
	MetadataListExtentsByStoreScope
	// MetadataListExtentsByConsGroupScope represents method within metadatamgr
	MetadataListExtentsByConsGroupScope
	// MetadataListConsGroupsByDstScope represents method within metadatamgr
	MetadataListConsGroupsByDstScope
	// MetadataListConsumerGroupsPageScope represents method within metadatamgr
	MetadataListConsumerGroupsPageScope
	// MetadataAddExtentToConsGroupScope represents method within metadatamgr
	MetadataAddExtentToConsGroupScope
	// MetadataCreateExtentScope represents method within metadatamgr
	MetadataCreateExtentScope
	// MetadataUpdateOutputScope represents method within metadatamgr
	MetadataUpdateOutputScope
	// MetadataSealExtentScope represents method within metadatamgr
	MetadataSealExtentScope
	// MetadataDeleteConsumerGroupScope represents method within metadatamgr
	MetadataDeleteConsumerGroupScope
	// MetadataUpdateDLQCursorScope represents a method within metadatamgr
	MetadataUpdateDLQCursorScope
	// MetadataMoveExtentScope lorem ipsum
	MetadataMoveExtentScope
	// MetadataReadConsumerGroupScope lorem ipsum
	MetadataReadConsumerGroupScope
	// MetadataReadConsumerGroupByUUIDScope lorem ipsum
	MetadataReadConsumerGroupByUUIDScope
	// MetadataUpdateExtentStatsScope lorem ipsum
	MetadataUpdateExtentStatsScope
	// MetadataUpdateConsumerGroupExtentStatusScope lorem ipsum
	MetadataUpdateConsumerGroupExtentStatusScope
	// MetadataDeleteDestinationUUIDScope lorem ipsum
	MetadataDeleteDestinationUUIDScope

	// 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
	//PutMessageBatchInputHostDestScope represent API PutMessageBatch for per destination
	PutMessageBatchInputHostDestScope

	//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
	// StoreExtentStatusOutOfSyncEventScope represents an event handler
	StoreExtentStatusOutOfSyncEventScope
	// RemoteZoneExtentCreatedEventScope represents event handler
	RemoteZoneExtentCreatedEventScope
	// 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
	// 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

	// 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

	// OpenReplicationRemoteReadScope represents OpenReplicationRemoteRead API
	OpenReplicationRemoteReadScope
	// OpenReplicationReadScope represents OpenReplicationRead API
	OpenReplicationReadScope
	// 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
	// ReplicatorCreateExtentScope represents replicator CreateExtent API
	ReplicatorCreateExtentScope
	// ReplicatorCreateRmtExtentScope represents replicator CreateRemoteExtent API
	ReplicatorCreateRmtExtentScope
	// 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

	// 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
	// InputhostReceiveMessageLatency is the latency to recieve a message
	InputhostReceiveMessageLatency
	// 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
	// InputhostDestReceiveMessageLatency  indicates name for destinations request latency
	InputhostDestReceiveMessageLatency
	// InputhostDestPubConnection is the gauge of active connections per destination
	InputhostDestPubConnection

	// OutputhostRequests indicates the request count for outputhost
	OutputhostRequests
	// OutputhostFailures indicates failure count for outputhost
	OutputhostFailures
	// OutputhostLongPollingTimeOut indicates time out for long polling
	OutputhostLongPollingTimeOut
	// 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
	// OutputhostLatencyTimer represents time taken by an operation
	OutputhostLatencyTimer
	// OutputhostCGMessageSent records the count of messages sent per consumer group
	OutputhostCGMessageSent
	// 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
	// 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

	// 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 to write message to store and ack
	StorageWriteMessageLatency
	// 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

	// 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

	// 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

	// ReplicatorWsFailure indicates websocket failure
	ReplicatorWsFailure
	// 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

	// ReplicatorOutConnCreditsSent indicates how many credits OutConn sent
	ReplicatorOutConnCreditsSent
	// ReplicatorOutConnMsgRead indicates how many messages OutConn read
	ReplicatorOutConnMsgRead
	// 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
	// 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
	// ReplicatorReconcileDestExtentInconsistentStatus indicates the reconcile for dest extent found an inconsistent extent status
	ReplicatorReconcileDestExtentInconsistentStatus
)

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

This section is empty.

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 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

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 M3

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL