Skip to content

Commit

Permalink
exported var revision
Browse files Browse the repository at this point in the history
  • Loading branch information
ericharmeling committed Aug 9, 2023
1 parent d8524b2 commit f9358b8
Show file tree
Hide file tree
Showing 29 changed files with 154 additions and 160 deletions.
18 changes: 9 additions & 9 deletions pkg/ccl/changefeedccl/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ func newAggregateMetrics(histogramWindow time.Duration) *AggMetrics {
Duration: histogramWindow,
MaxVal: 10 << 20, /* 10MB max message size */
SigFigs: 1,
BucketConfig: metric.StaticBucketConfigs[metric.DataSize16MBBuckets],
BucketConfig: metric.DataSize16MBBuckets,
}),
EmittedBytes: b.Counter(metaChangefeedEmittedBytes),
FlushedBytes: b.Counter(metaChangefeedFlushedBytes),
Expand All @@ -567,7 +567,7 @@ func newAggregateMetrics(histogramWindow time.Duration) *AggMetrics {
Duration: histogramWindow,
MaxVal: changefeedIOQueueMaxLatency.Nanoseconds(),
SigFigs: 2,
BucketConfig: metric.StaticBucketConfigs[metric.BatchProcessLatencyBuckets],
BucketConfig: metric.BatchProcessLatencyBuckets,
}),
SinkIOInflight: b.Gauge(metaChangefeedSinkIOInflight),

Expand All @@ -576,28 +576,28 @@ func newAggregateMetrics(histogramWindow time.Duration) *AggMetrics {
Duration: histogramWindow,
MaxVal: changefeedBatchHistMaxLatency.Nanoseconds(),
SigFigs: 1,
BucketConfig: metric.StaticBucketConfigs[metric.BatchProcessLatencyBuckets],
BucketConfig: metric.BatchProcessLatencyBuckets,
}),
FlushHistNanos: b.Histogram(metric.HistogramOptions{
Metadata: metaChangefeedFlushHistNanos,
Duration: histogramWindow,
MaxVal: changefeedFlushHistMaxLatency.Nanoseconds(),
SigFigs: 2,
BucketConfig: metric.StaticBucketConfigs[metric.BatchProcessLatencyBuckets],
BucketConfig: metric.BatchProcessLatencyBuckets,
}),
CommitLatency: b.Histogram(metric.HistogramOptions{
Metadata: metaCommitLatency,
Duration: histogramWindow,
MaxVal: commitLatencyMaxValue.Nanoseconds(),
SigFigs: 1,
BucketConfig: metric.StaticBucketConfigs[metric.BatchProcessLatencyBuckets],
BucketConfig: metric.BatchProcessLatencyBuckets,
}),
AdmitLatency: b.Histogram(metric.HistogramOptions{
Metadata: metaAdmitLatency,
Duration: histogramWindow,
MaxVal: admitLatencyMaxValue.Nanoseconds(),
SigFigs: 1,
BucketConfig: metric.StaticBucketConfigs[metric.BatchProcessLatencyBuckets],
BucketConfig: metric.BatchProcessLatencyBuckets,
}),
BackfillCount: b.Gauge(metaChangefeedBackfillCount),
BackfillPendingRanges: b.Gauge(metaChangefeedBackfillPendingRanges),
Expand Down Expand Up @@ -716,7 +716,7 @@ func MakeMetrics(histogramWindow time.Duration) metric.Struct {
Duration: histogramWindow,
MaxVal: changefeedCheckpointHistMaxLatency.Nanoseconds(),
SigFigs: 2,
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
FrontierUpdates: metric.NewCounter(metaChangefeedFrontierUpdates),
ThrottleMetrics: cdcutils.MakeMetrics(histogramWindow),
Expand All @@ -725,13 +725,13 @@ func MakeMetrics(histogramWindow time.Duration) metric.Struct {
ParallelConsumerFlushNanos: metric.NewHistogram(metric.HistogramOptions{
Metadata: metaChangefeedEventConsumerFlushNanos,
Duration: histogramWindow,
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
Mode: metric.HistogramModePrometheus,
}),
ParallelConsumerConsumeNanos: metric.NewHistogram(metric.HistogramOptions{
Metadata: metaChangefeedEventConsumerConsumeNanos,
Duration: histogramWindow,
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
Mode: metric.HistogramModePrometheus,
}),
ParallelConsumerInFlightEvents: metric.NewGauge(metaChangefeedEventConsumerInFlightEvents),
Expand Down
6 changes: 3 additions & 3 deletions pkg/ccl/sqlproxyccl/connector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ func TestConnector_dialTenantCluster(t *testing.T) {
Mode: metric.HistogramModePrometheus,
Metadata: metaDialTenantLatency,
Duration: time.Millisecond,
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
DialTenantRetries: metric.NewCounter(metaDialTenantRetries),
}
Expand Down Expand Up @@ -469,7 +469,7 @@ func TestConnector_dialTenantCluster(t *testing.T) {
Mode: metric.HistogramModePreferHdrLatency,
Metadata: metaDialTenantLatency,
Duration: time.Millisecond,
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
DialTenantRetries: metric.NewCounter(metaDialTenantRetries),
}
Expand Down Expand Up @@ -503,7 +503,7 @@ func TestConnector_dialTenantCluster(t *testing.T) {
Mode: metric.HistogramModePreferHdrLatency,
Metadata: metaDialTenantLatency,
Duration: time.Millisecond,
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
DialTenantRetries: metric.NewCounter(metaDialTenantRetries),
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/ccl/sqlproxyccl/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func makeProxyMetrics() metrics {
Mode: metric.HistogramModePreferHdrLatency,
Metadata: metaConnMigrationAttemptedCount,
Duration: base.DefaultHistogramWindowInterval(),
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
AuthFailedCount: metric.NewCounter(metaAuthFailedCount),
ExpiredClientConnCount: metric.NewCounter(metaExpiredClientConnCount),
Expand All @@ -246,7 +246,7 @@ func makeProxyMetrics() metrics {
Mode: metric.HistogramModePreferHdrLatency,
Metadata: metaDialTenantLatency,
Duration: base.DefaultHistogramWindowInterval(),
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets]},
BucketConfig: metric.IOLatencyBuckets},
),
DialTenantRetries: metric.NewCounter(metaDialTenantRetries),
// Connection migration metrics.
Expand All @@ -258,12 +258,12 @@ func makeProxyMetrics() metrics {
Mode: metric.HistogramModePreferHdrLatency,
Metadata: metaConnMigrationAttemptedLatency,
Duration: base.DefaultHistogramWindowInterval(),
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
ConnMigrationTransferResponseMessageSize: metric.NewHistogram(metric.HistogramOptions{
Metadata: metaConnMigrationTransferResponseMessageSize,
Duration: base.DefaultHistogramWindowInterval(),
BucketConfig: metric.StaticBucketConfigs[metric.DataSize16MBBuckets],
BucketConfig: metric.DataSize16MBBuckets,
MaxVal: maxExpectedTransferResponseMessageSize,
SigFigs: 1,
}),
Expand Down
6 changes: 3 additions & 3 deletions pkg/ccl/streamingccl/streamingest/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,21 @@ func MakeMetrics(histogramWindow time.Duration) metric.Struct {
FlushHistNanos: metric.NewHistogram(metric.HistogramOptions{
Metadata: metaReplicationFlushHistNanos,
Duration: histogramWindow,
BucketConfig: metric.StaticBucketConfigs[metric.BatchProcessLatencyBuckets],
BucketConfig: metric.BatchProcessLatencyBuckets,
MaxVal: streamingFlushHistMaxLatency.Nanoseconds(),
SigFigs: 1,
}),
CommitLatency: metric.NewHistogram(metric.HistogramOptions{
Metadata: metaReplicationCommitLatency,
Duration: histogramWindow,
BucketConfig: metric.StaticBucketConfigs[metric.BatchProcessLatencyBuckets],
BucketConfig: metric.BatchProcessLatencyBuckets,
MaxVal: streamingCommitLatencyMaxValue.Nanoseconds(),
SigFigs: 1,
}),
AdmitLatency: metric.NewHistogram(metric.HistogramOptions{
Metadata: metaReplicationAdmitLatency,
Duration: histogramWindow,
BucketConfig: metric.StaticBucketConfigs[metric.BatchProcessLatencyBuckets],
BucketConfig: metric.BatchProcessLatencyBuckets,
MaxVal: streamingAdmitLatencyMaxValue.Nanoseconds(),
SigFigs: 1,
}),
Expand Down
2 changes: 1 addition & 1 deletion pkg/kv/bulk/bulk_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func MakeBulkMetrics(histogramWindow time.Duration) Metrics {
Duration: histogramWindow,
MaxVal: log10int64times1000,
SigFigs: 3,
BucketConfig: metric.StaticBucketConfigs[metric.MemoryUsage64MBBuckets],
BucketConfig: metric.MemoryUsage64MBBuckets,
}),
CurBytesCount: metric.NewGauge(metaMemCurBytes),
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/kv/kvclient/kvcoord/txn_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ func MakeTxnMetrics(histogramWindow time.Duration) TxnMetrics {
Mode: metric.HistogramModePreferHdrLatency,
Metadata: metaDurationsHistograms,
Duration: histogramWindow,
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
TxnsWithCondensedIntents: metric.NewCounter(metaTxnsWithCondensedIntentSpans),
TxnsWithCondensedIntentsGauge: metric.NewGauge(metaTxnsWithCondensedIntentSpansGauge),
Expand All @@ -298,7 +298,7 @@ func MakeTxnMetrics(histogramWindow time.Duration) TxnMetrics {
Duration: histogramWindow,
MaxVal: 100,
SigFigs: 3,
BucketConfig: metric.StaticBucketConfigs[metric.Count1KBuckets],
BucketConfig: metric.Count1KBuckets,
}),
RestartsWriteTooOld: telemetry.NewCounterWithMetric(metaRestartsWriteTooOld),
RestartsWriteTooOldMulti: telemetry.NewCounterWithMetric(metaRestartsWriteTooOldMulti),
Expand Down
4 changes: 2 additions & 2 deletions pkg/kv/kvprober/kvprober.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,15 @@ func NewProber(opts Opts) *Prober {
Mode: metric.HistogramModePreferHdrLatency,
Metadata: metaReadProbeLatency,
Duration: opts.HistogramWindowInterval,
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
WriteProbeAttempts: metric.NewCounter(metaWriteProbeAttempts),
WriteProbeFailures: metric.NewCounter(metaWriteProbeFailures),
WriteProbeLatency: metric.NewHistogram(metric.HistogramOptions{
Mode: metric.HistogramModePreferHdrLatency,
Metadata: metaWriteProbeLatency,
Duration: opts.HistogramWindowInterval,
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
WriteProbeQuarantineOldestDuration: metric.NewFunctionalGauge(
metaWriteProbeQuarantineOldestDuration,
Expand Down
2 changes: 1 addition & 1 deletion pkg/kv/kvserver/client_manual_proposal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ LIMIT
Mode: metric.HistogramModePrometheus,
Metadata: fakeMeta,
Duration: time.Millisecond,
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func newMetrics(c *Controller) *metrics {
metric.HistogramOptions{
Metadata: annotateMetricTemplateWithWorkClass(wc, waitDuration),
Duration: base.DefaultHistogramWindowInterval(),
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
Mode: metric.HistogramModePrometheus,
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func NewMetrics(registry *metric.Registry) *Metrics {
metric.HistogramOptions{
Metadata: annotateMetricTemplateWithWorkClass(wc, waitDuration),
Duration: base.DefaultHistogramWindowInterval(),
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
Mode: metric.HistogramModePrometheus,
},
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/kv/kvserver/liveness/liveness.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ func NewNodeLiveness(opts NodeLivenessOptions) *NodeLiveness {
Mode: metric.HistogramModePreferHdrLatency,
Metadata: metaHeartbeatLatency,
Duration: opts.HistogramWindowInterval,
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
}
nl.cache = newCache(opts.Gossip, opts.Clock, nl.cacheUpdated)
Expand Down
2 changes: 1 addition & 1 deletion pkg/kv/kvserver/logstore/logstore_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func runBenchmarkLogStore_StoreEntries(b *testing.B, bytes int64) {
Mode: metric.HistogramModePrometheus,
Metadata: metric.Metadata{},
Duration: 10 * time.Second,
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
},
}
Expand Down
24 changes: 12 additions & 12 deletions pkg/kv/kvserver/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -2841,7 +2841,7 @@ func newStoreMetrics(histogramWindow time.Duration) *StoreMetrics {
Mode: metric.HistogramModePreferHdrLatency,
Metadata: metaLeaseRequestLatency,
Duration: histogramWindow,
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
LeaseTransferSuccessCount: metric.NewCounter(metaLeaseTransferSuccessCount),
LeaseTransferErrorCount: metric.NewCounter(metaLeaseTransferErrorCount),
Expand Down Expand Up @@ -2871,13 +2871,13 @@ func newStoreMetrics(histogramWindow time.Duration) *StoreMetrics {
AverageCPUNanosPerSecond: metric.NewGaugeFloat64(metaAverageCPUNanosPerSecond),
RecentReplicaCPUNanosPerSecond: metric.NewManualWindowHistogram(
metaRecentReplicaCPUNanosPerSecond,
metric.StaticBucketConfigs[metric.ReplicaCPUTimeBuckets].
metric.ReplicaCPUTimeBuckets.
GetBucketsFromBucketConfig(),
true, /* withRotate */
),
RecentReplicaQueriesPerSecond: metric.NewManualWindowHistogram(
metaRecentReplicaQueriesPerSecond,
metric.StaticBucketConfigs[metric.ReplicaBatchRequestCountBuckets].
metric.ReplicaBatchRequestCountBuckets.
GetBucketsFromBucketConfig(),
true, /* withRotate */
),
Expand Down Expand Up @@ -3014,7 +3014,7 @@ func newStoreMetrics(histogramWindow time.Duration) *StoreMetrics {
Duration: histogramWindow,
MaxVal: 100,
SigFigs: 1,
BucketConfig: metric.StaticBucketConfigs[metric.Percent100Buckets],
BucketConfig: metric.Percent100Buckets,
}),
RaftWorkingDurationNanos: metric.NewCounter(metaRaftWorkingDurationNanos),
RaftTickingDurationNanos: metric.NewCounter(metaRaftTickingDurationNanos),
Expand All @@ -3023,37 +3023,37 @@ func newStoreMetrics(histogramWindow time.Duration) *StoreMetrics {
Mode: metric.HistogramModePreferHdrLatency,
Metadata: metaRaftLogCommitLatency,
Duration: histogramWindow,
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
RaftCommandCommitLatency: metric.NewHistogram(metric.HistogramOptions{
Mode: metric.HistogramModePreferHdrLatency,
Metadata: metaRaftCommandCommitLatency,
Duration: histogramWindow,
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
RaftHandleReadyLatency: metric.NewHistogram(metric.HistogramOptions{
Mode: metric.HistogramModePreferHdrLatency,
Metadata: metaRaftHandleReadyLatency,
Duration: histogramWindow,
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
RaftApplyCommittedLatency: metric.NewHistogram(metric.HistogramOptions{
Mode: metric.HistogramModePreferHdrLatency,
Metadata: metaRaftApplyCommittedLatency,
Duration: histogramWindow,
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
RaftReplicationLatency: metric.NewHistogram(metric.HistogramOptions{
Mode: metric.HistogramModePrometheus,
Metadata: metaRaftReplicationLatency,
Duration: histogramWindow,
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
RaftSchedulerLatency: metric.NewHistogram(metric.HistogramOptions{
Mode: metric.HistogramModePreferHdrLatency,
Metadata: metaRaftSchedulerLatency,
Duration: histogramWindow,
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
RaftTimeoutCampaign: metric.NewCounter(metaRaftTimeoutCampaign),
RaftStorageReadBytes: metric.NewCounter(metaRaftStorageReadBytes),
Expand Down Expand Up @@ -3206,13 +3206,13 @@ func newStoreMetrics(histogramWindow time.Duration) *StoreMetrics {
Mode: metric.HistogramModePreferHdrLatency,
Metadata: metaReplicaReadBatchEvaluationLatency,
Duration: histogramWindow,
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
ReplicaWriteBatchEvaluationLatency: metric.NewHistogram(metric.HistogramOptions{
Mode: metric.HistogramModePreferHdrLatency,
Metadata: metaReplicaWriteBatchEvaluationLatency,
Duration: histogramWindow,
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
FlushUtilization: metric.NewGaugeFloat64(metaStorageFlushUtilization),
FsyncLatency: metric.NewManualWindowHistogram(
Expand Down
4 changes: 2 additions & 2 deletions pkg/kv/kvserver/txnwait/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func NewMetrics(histogramWindowInterval time.Duration) *Metrics {
MaxVal: time.Hour.Nanoseconds(),
SigFigs: 1,
Duration: histogramWindowInterval,
BucketConfig: metric.StaticBucketConfigs[metric.LongRunning60mLatencyBuckets],
BucketConfig: metric.LongRunning60mLatencyBuckets,
}),

QueryWaitTime: metric.NewHistogram(metric.HistogramOptions{
Expand All @@ -89,7 +89,7 @@ func NewMetrics(histogramWindowInterval time.Duration) *Metrics {
MaxVal: time.Hour.Nanoseconds(),
SigFigs: 1,
Duration: histogramWindowInterval,
BucketConfig: metric.StaticBucketConfigs[metric.LongRunning60mLatencyBuckets],
BucketConfig: metric.LongRunning60mLatencyBuckets,
}),

DeadlocksTotal: metric.NewCounter(
Expand Down
2 changes: 1 addition & 1 deletion pkg/rpc/clock_offset.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func newRemoteClockMonitor(
// NB: the choice of IO over Network buckets is somewhat debatable, but
// it's fine. Heartbeats can take >1s which the IO buckets can represent,
// but the Network buckets top out at 1s.
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
}
return &r
Expand Down
2 changes: 1 addition & 1 deletion pkg/server/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func makeNodeMetrics(reg *metric.Registry, histogramWindow time.Duration) nodeMe
Mode: metric.HistogramModePreferHdrLatency,
Metadata: metaExecLatency,
Duration: histogramWindow,
BucketConfig: metric.StaticBucketConfigs[metric.IOLatencyBuckets],
BucketConfig: metric.IOLatencyBuckets,
}),
Success: metric.NewCounter(metaExecSuccess),
Err: metric.NewCounter(metaExecError),
Expand Down
Loading

0 comments on commit f9358b8

Please sign in to comment.