-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
131025: storeliveness: add transport metrics r=nvanbenschoten a=miraradeva This commit adds seven new metrics for the Store Liveness Transport: - `storeliveness.transport.send-queue-size`: Number of pending outgoing messages in all Store Liveness Transport per-store send queues. - `storeliveness.transport.send-queue-bytes`: Total byte size of pending outgoing messages in all Store Liveness Transport per-store send queues. - `storeliveness.transport.send-queue-idle`: Number of Store Liveness Transport per-store send queues that have become idle due to no recently-sent messages. - `storeliveness.transport.sent`: Number of Store Liveness messages sent by the Store Liveness Transport. - `storeliveness.transport.received`: Number of Store Liveness messages received by the Store Liveness Transport. - `storeliveness.transport.send_dropped`: Number of Store Liveness messages dropped by the Store Liveness Transport on the sender side. - `storeliveness.transport.receive_dropped`: Number of Store Liveness messages dropped by the Store Liveness Transport on the receiver side. Part of: #125067 Release note: None ---- <img width="1095" alt="Screenshot 2024-09-20 at 1 20 18 PM" src="https://github.com/user-attachments/assets/bf9bcce7-4055-44fd-a0b1-afeb3fc65268"> Co-authored-by: Mira Radeva <[email protected]>
- Loading branch information
Showing
11 changed files
with
426 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
// Copyright 2024 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
package storeliveness | ||
|
||
import "github.com/cockroachdb/cockroach/pkg/util/metric" | ||
|
||
// TransportMetrics includes all Store Liveness Transport metrics. | ||
type TransportMetrics struct { | ||
SendQueueSize *metric.Gauge | ||
SendQueueBytes *metric.Gauge | ||
SendQueueIdle *metric.Counter | ||
|
||
MessagesSent *metric.Counter | ||
MessagesReceived *metric.Counter | ||
MessagesSendDropped *metric.Counter | ||
MessagesReceiveDropped *metric.Counter | ||
} | ||
|
||
func newTransportMetrics() *TransportMetrics { | ||
return &TransportMetrics{ | ||
SendQueueSize: metric.NewGauge(metaSendQueueSize), | ||
SendQueueBytes: metric.NewGauge(metaSendQueueBytes), | ||
SendQueueIdle: metric.NewCounter(metaSendQueueIdle), | ||
MessagesSent: metric.NewCounter(metaMessagesSent), | ||
MessagesReceived: metric.NewCounter(metaMessagesReceived), | ||
MessagesSendDropped: metric.NewCounter(metaMessagesSendDropped), | ||
MessagesReceiveDropped: metric.NewCounter(metaMessagesReceiveDropped), | ||
} | ||
} | ||
|
||
var ( | ||
metaSendQueueSize = metric.Metadata{ | ||
Name: "storeliveness.transport.send-queue-size", | ||
Help: "Number of pending outgoing messages in all " + | ||
"Store Liveness Transport per-store send queues", | ||
Measurement: "Messages", | ||
Unit: metric.Unit_COUNT, | ||
} | ||
metaSendQueueBytes = metric.Metadata{ | ||
Name: "storeliveness.transport.send-queue-bytes", | ||
Help: "Total byte size of pending outgoing messages in all " + | ||
"Store Liveness Transport per-store send queues", | ||
Measurement: "Bytes", | ||
Unit: metric.Unit_BYTES, | ||
} | ||
metaSendQueueIdle = metric.Metadata{ | ||
Name: "storeliveness.transport.send-queue-idle", | ||
Help: "Number of Store Liveness Transport per-store send queues " + | ||
"that have become idle due to no recently-sent messages", | ||
Measurement: "Messages", | ||
Unit: metric.Unit_COUNT, | ||
} | ||
metaMessagesSent = metric.Metadata{ | ||
Name: "storeliveness.transport.sent", | ||
Help: "Number of Store Liveness messages sent by the " + | ||
"Store Liveness Transport", | ||
Measurement: "Messages", | ||
Unit: metric.Unit_COUNT, | ||
} | ||
metaMessagesReceived = metric.Metadata{ | ||
Name: "storeliveness.transport.received", | ||
Help: "Number of Store Liveness messages received by the " + | ||
"Store Liveness Transport", | ||
Measurement: "Messages", | ||
Unit: metric.Unit_COUNT, | ||
} | ||
metaMessagesSendDropped = metric.Metadata{ | ||
Name: "storeliveness.transport.send_dropped", | ||
Help: "Number of Store Liveness messages dropped by the " + | ||
"Store Liveness Transport on the sender side", | ||
Measurement: "Messages", | ||
Unit: metric.Unit_COUNT, | ||
} | ||
metaMessagesReceiveDropped = metric.Metadata{ | ||
Name: "storeliveness.transport.receive_dropped", | ||
Help: "Number of Store Liveness messages dropped by the " + | ||
"Store Liveness Transport on the receiver side", | ||
Measurement: "Messages", | ||
Unit: metric.Unit_COUNT, | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.