Documentation
¶
Index ¶
Constants ¶
View Source
const ( TableStatePending = "pending" // for the TableCounter labels, below too TableStateImported = "imported" TableStateCompleted = "completed" StateTotalRestore = "total_restore" // total source data bytes needs to restore StateRestored = "restored" // source data bytes restored during restore engine StateRestoreWritten = "written" // bytes written during restore engine StateImported = "imported" // bytes imported during import engine ProgressPhaseTotal = "total" // total restore progress(not include post-process, like checksum and analyze) ProgressPhaseRestore = "restore" // restore engine progress ProgressPhaseImport = "import" // import engine progress TableResultSuccess = "success" // for the TableCounter labels, below too TableResultFailure = "failure" ChunkStateEstimated = "estimated" // for the ChunkCounter labels, below too ChunkStatePending = "pending" ChunkStateRunning = "running" ChunkStateFinished = "finished" ChunkStateFailed = "failed" SSTProcessSplit = "split" // for the SSTSecondsHistogram labels, below too SSTProcessWrite = "write" SSTProcessIngest = "ingest" BlockDeliverKindIndex = "index" BlockDeliverKindData = "data" )
metric label values.
Variables ¶
This section is empty.
Functions ¶
func NewContext ¶
NewContext returns a new context with the provided metrics.
func ReadAllCounters ¶
func ReadAllCounters(metricsVec *prometheus.MetricVec, labels prometheus.Labels) float64
ReadAllCounters reports the summary value of the counters with given labels.
func ReadCounter ¶
func ReadCounter(counter prometheus.Counter) float64
ReadCounter reports the current value of the counter.
func ReadHistogramSum ¶
func ReadHistogramSum(histogram prometheus.Histogram) float64
ReadHistogramSum reports the sum of all observed values in the histogram.
Types ¶
type Metrics ¶
type Metrics struct { ImporterEngineCounter *prometheus.CounterVec IdleWorkersGauge *prometheus.GaugeVec KvEncoderCounter *prometheus.CounterVec TableCounter *prometheus.CounterVec ProcessedEngineCounter *prometheus.CounterVec ChunkCounter *prometheus.CounterVec BytesCounter *prometheus.CounterVec RowsCounter *prometheus.CounterVec ImportSecondsHistogram prometheus.Histogram ChunkParserReadBlockSecondsHistogram prometheus.Histogram ApplyWorkerSecondsHistogram *prometheus.HistogramVec RowReadSecondsHistogram prometheus.Histogram RowReadBytesHistogram prometheus.Histogram RowEncodeSecondsHistogram prometheus.Histogram RowKVDeliverSecondsHistogram prometheus.Histogram BlockDeliverSecondsHistogram prometheus.Histogram BlockDeliverBytesHistogram *prometheus.HistogramVec BlockDeliverKVPairsHistogram *prometheus.HistogramVec ChecksumSecondsHistogram prometheus.Histogram SSTSecondsHistogram *prometheus.HistogramVec LocalStorageUsageBytesGauge *prometheus.GaugeVec ProgressGauge *prometheus.GaugeVec }
Metrics contains all metrics used by lightning.
func FromContext ¶
FromContext returns the metrics stored in the context.
func NewMetrics ¶
NewMetrics creates a new empty metrics.
func (*Metrics) RecordEngineCount ¶
RecordEngineCount records the number of engines processed.
func (*Metrics) RecordTableCount ¶
RecordTableCount records the number of tables processed.
func (*Metrics) RegisterTo ¶
RegisterTo registers all metrics to the given registry.
func (*Metrics) UnregisterFrom ¶
UnregisterFrom unregisters all metrics from the given registry.
Click to show internal directories.
Click to hide internal directories.