Upgrade versions of vendored libs
This commit is contained in:
70
vendor/github.com/cockroachdb/pebble/metrics.go
generated
vendored
70
vendor/github.com/cockroachdb/pebble/metrics.go
generated
vendored
@@ -6,13 +6,15 @@ package pebble
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/cockroachdb/pebble/internal/base"
|
||||
"github.com/cockroachdb/pebble/internal/cache"
|
||||
"github.com/cockroachdb/pebble/internal/humanize"
|
||||
"github.com/cockroachdb/pebble/record"
|
||||
"github.com/cockroachdb/pebble/sstable"
|
||||
"github.com/cockroachdb/redact"
|
||||
"github.com/codahale/hdrhistogram"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
// CacheMetrics holds metrics for the block and table cache.
|
||||
@@ -140,6 +142,7 @@ type Metrics struct {
|
||||
MoveCount int64
|
||||
ReadCount int64
|
||||
RewriteCount int64
|
||||
MultiLevelCount int64
|
||||
// An estimate of the number of bytes that need to be compacted for the LSM
|
||||
// to reach a stable state.
|
||||
EstimatedDebt uint64
|
||||
@@ -157,7 +160,8 @@ type Metrics struct {
|
||||
|
||||
Flush struct {
|
||||
// The total number of flushes.
|
||||
Count int64
|
||||
Count int64
|
||||
WriteThroughput ThroughputMetric
|
||||
}
|
||||
|
||||
Filter FilterMetrics
|
||||
@@ -177,6 +181,11 @@ type Metrics struct {
|
||||
ZombieCount int64
|
||||
}
|
||||
|
||||
Keys struct {
|
||||
// The approximate count of internal range key set keys in the database.
|
||||
RangeKeySetsCount uint64
|
||||
}
|
||||
|
||||
Snapshots struct {
|
||||
// The number of currently open snapshots.
|
||||
Count int
|
||||
@@ -221,12 +230,26 @@ type Metrics struct {
|
||||
BytesWritten uint64
|
||||
}
|
||||
|
||||
LogWriter struct {
|
||||
FsyncLatency prometheus.Histogram
|
||||
record.LogWriterMetrics
|
||||
}
|
||||
|
||||
private struct {
|
||||
optionsFileSize uint64
|
||||
manifestFileSize uint64
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
// FsyncLatencyBuckets are prometheus histogram buckets suitable for a histogram
|
||||
// that records latencies for fsyncs.
|
||||
FsyncLatencyBuckets = append(
|
||||
prometheus.LinearBuckets(0.0, float64(time.Microsecond*100), 50),
|
||||
prometheus.ExponentialBucketsRange(float64(time.Millisecond*5), float64(10*time.Second), 50)...,
|
||||
)
|
||||
)
|
||||
|
||||
// DiskSpaceUsage returns the total disk space used by the database in bytes,
|
||||
// including live and obsolete files.
|
||||
func (m *Metrics) DiskSpaceUsage() uint64 {
|
||||
@@ -386,13 +409,14 @@ func (m *Metrics) SafeFormat(w redact.SafePrinter, _ rune) {
|
||||
humanize.IEC.Int64(m.Compact.InProgressBytes),
|
||||
redact.Safe(m.Compact.NumInProgress),
|
||||
redact.SafeString(""))
|
||||
w.Printf(" ctype %9d %7d %7d %7d %7d %7d (default, delete, elision, move, read, rewrite)\n",
|
||||
w.Printf(" ctype %9d %7d %7d %7d %7d %7d %7d (default, delete, elision, move, read, rewrite, multi-level)\n",
|
||||
redact.Safe(m.Compact.DefaultCount),
|
||||
redact.Safe(m.Compact.DeleteOnlyCount),
|
||||
redact.Safe(m.Compact.ElisionOnlyCount),
|
||||
redact.Safe(m.Compact.MoveCount),
|
||||
redact.Safe(m.Compact.ReadCount),
|
||||
redact.Safe(m.Compact.RewriteCount))
|
||||
redact.Safe(m.Compact.RewriteCount),
|
||||
redact.Safe(m.Compact.MultiLevelCount))
|
||||
w.Printf(" memtbl %9d %7s\n",
|
||||
redact.Safe(m.MemTable.Count),
|
||||
humanize.IEC.Uint64(m.MemTable.Size))
|
||||
@@ -422,41 +446,3 @@ func hitRate(hits, misses int64) float64 {
|
||||
}
|
||||
return 100 * float64(hits) / float64(sum)
|
||||
}
|
||||
|
||||
// InternalIntervalMetrics exposes metrics about internal subsystems, that can
|
||||
// be useful for deep observability purposes, and for higher-level admission
|
||||
// control systems that are trying to estimate the capacity of the DB. These
|
||||
// are experimental and subject to change, since they expose internal
|
||||
// implementation details, so do not rely on these without discussion with the
|
||||
// Pebble team.
|
||||
// These represent the metrics over the interval of time from the last call to
|
||||
// retrieve these metrics. These are not cumulative, unlike Metrics. The main
|
||||
// challenge in making these cumulative is the hdrhistogram.Histogram, which
|
||||
// does not have the ability to subtract a histogram from a preceding metric
|
||||
// retrieval.
|
||||
type InternalIntervalMetrics struct {
|
||||
// LogWriter metrics.
|
||||
LogWriter struct {
|
||||
// WriteThroughput is the WAL throughput.
|
||||
WriteThroughput ThroughputMetric
|
||||
// PendingBufferUtilization is the utilization of the WAL writer's
|
||||
// finite-sized pending blocks buffer. It provides an additional signal
|
||||
// regarding how close to "full" the WAL writer is. The value is in the
|
||||
// interval [0,1].
|
||||
PendingBufferUtilization float64
|
||||
// SyncQueueUtilization is the utilization of the WAL writer's
|
||||
// finite-sized queue of work that is waiting to sync. The value is in the
|
||||
// interval [0,1].
|
||||
SyncQueueUtilization float64
|
||||
// SyncLatencyMicros is a distribution of the fsync latency observed by
|
||||
// the WAL writer. It can be nil if there were no fsyncs.
|
||||
SyncLatencyMicros *hdrhistogram.Histogram
|
||||
}
|
||||
// Flush loop metrics.
|
||||
Flush struct {
|
||||
// WriteThroughput is the flushing throughput.
|
||||
WriteThroughput ThroughputMetric
|
||||
}
|
||||
// NB: the LogWriter throughput and the Flush throughput are not directly
|
||||
// comparable because the former does not compress, unlike the latter.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user