Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PhaseIdle = "idle" PhaseBeginTxn = "begin_txn" PhaseCommitTxn = "commit_txn" PhaseQuery = "query" PhaseCheckTTL = "check_ttl" PhaseWaitRetry = "wait_retry" PhaseDispatch = "dispatch" PhaseWaitToken = "wait_token" PhaseOther = "other" )
Phases to trace
View Source
var ( SelectSuccessDuration = metrics.TTLQueryDuration.With(prometheus.Labels{metrics.LblSQLType: "select", metrics.LblResult: metrics.LblOK}) SelectErrorDuration = metrics.TTLQueryDuration.With(prometheus.Labels{metrics.LblSQLType: "select", metrics.LblResult: metrics.LblError}) DeleteSuccessDuration = metrics.TTLQueryDuration.With(prometheus.Labels{metrics.LblSQLType: "delete", metrics.LblResult: metrics.LblOK}) DeleteErrorDuration = metrics.TTLQueryDuration.With(prometheus.Labels{metrics.LblSQLType: "delete", metrics.LblResult: metrics.LblError}) ScannedExpiredRows = metrics.TTLProcessedExpiredRowsCounter.With(prometheus.Labels{metrics.LblSQLType: "select", metrics.LblResult: metrics.LblOK}) DeleteSuccessExpiredRows = metrics.TTLProcessedExpiredRowsCounter.With(prometheus.Labels{metrics.LblSQLType: "delete", metrics.LblResult: metrics.LblOK}) DeleteErrorExpiredRows = metrics.TTLProcessedExpiredRowsCounter.With(prometheus.Labels{metrics.LblSQLType: "delete", metrics.LblResult: metrics.LblError}) RunningJobsCnt = metrics.TTLJobStatus.With(prometheus.Labels{metrics.LblType: "running"}) CancellingJobsCnt = metrics.TTLJobStatus.With(prometheus.Labels{metrics.LblType: "cancelling"}) )
TTL metrics
Functions ¶
func CtxWithPhaseTracer ¶
func CtxWithPhaseTracer(ctx context.Context, tracer *PhaseTracer) context.Context
CtxWithPhaseTracer create a new context with tracer
Types ¶
type PhaseTracer ¶
type PhaseTracer struct {
// contains filtered or unexported fields
}
PhaseTracer is used to tracer the phases duration
func NewDeleteWorkerPhaseTracer ¶
func NewDeleteWorkerPhaseTracer() *PhaseTracer
NewDeleteWorkerPhaseTracer returns a tracer for delete worker
func NewScanWorkerPhaseTracer ¶
func NewScanWorkerPhaseTracer() *PhaseTracer
NewScanWorkerPhaseTracer returns a tracer for scan worker
func PhaseTracerFromCtx ¶
func PhaseTracerFromCtx(ctx context.Context) *PhaseTracer
PhaseTracerFromCtx returns a tracer from a given context
func (*PhaseTracer) EnterPhase ¶
func (t *PhaseTracer) EnterPhase(phase string)
EnterPhase enters into a new phase
Click to show internal directories.
Click to hide internal directories.