Skip to content

Commit

Permalink
total_received_gossip_hop 用のメトリクスを追加する
Browse files Browse the repository at this point in the history
  • Loading branch information
sile committed Jan 7, 2025
1 parent 8634632 commit 12dd98b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
26 changes: 15 additions & 11 deletions collector/cluster_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var (

clusterRelayPlumtreeSentGossipTotal: newDescWithLabel("cluster_relay_plumtree_sent_gossip_total", "The total number of Plumtree GOSSIP messages sent by the cluster relay.", []string{"node_name"}),
clusterRelayPlumtreeReceivedGossipTotal: newDescWithLabel("cluster_relay_plumtree_received_gossip_total", "The total number of Plumtree GOSSIP messages received by the cluster relay.", []string{"node_name"}),
clusterRelayPlumtreeReceivedGossipHopTotal: newDescWithLabel("cluster_relay_plumtree_received_gossip_hop_total", "The total number of hop count of Plumtree GOSSIP messages received by the cluster relay.", []string{"node_name"}),
clusterRelayPlumtreeSentIhaveTotal: newDescWithLabel("cluster_relay_plumtree_sent_ihave_total", "The total number of Plumtree IHAVE messages sent by the cluster relay.", []string{"node_name"}),
clusterRelayPlumtreeReceivedIhaveTotal: newDescWithLabel("cluster_relay_plumtree_received_ihave_total", "The total number of Plumtree IHAVE messages received by the cluster relay.", []string{"node_name"}),
clusterRelayPlumtreeSentGraftTotal: newDescWithLabel("cluster_relay_plumtree_sent_graft_total", "The total number of Plumtree GRAFT messages sent by the cluster relay.", []string{"node_name"}),
Expand All @@ -41,17 +42,18 @@ type SoraClusterMetrics struct {
clusterRelayReceivedPacketsTotal *prometheus.Desc
clusterRelaySentPacketsTotal *prometheus.Desc

clusterRelayPlumtreeSentGossipTotal *prometheus.Desc
clusterRelayPlumtreeReceivedGossipTotal *prometheus.Desc
clusterRelayPlumtreeSentIhaveTotal *prometheus.Desc
clusterRelayPlumtreeReceivedIhaveTotal *prometheus.Desc
clusterRelayPlumtreeSentGraftTotal *prometheus.Desc
clusterRelayPlumtreeReceivedGraftTotal *prometheus.Desc
clusterRelayPlumtreeSentPruneTotal *prometheus.Desc
clusterRelayPlumtreeReceivedPruneTotal *prometheus.Desc
clusterRelayPlumtreeGraftMissTotal *prometheus.Desc
clusterRelayPlumtreeSkippedSendTotal *prometheus.Desc
clusterRelayPlumtreeIgnoredTotal *prometheus.Desc
clusterRelayPlumtreeSentGossipTotal *prometheus.Desc
clusterRelayPlumtreeReceivedGossipTotal *prometheus.Desc
clusterRelayPlumtreeReceivedGossipHopTotal *prometheus.Desc
clusterRelayPlumtreeSentIhaveTotal *prometheus.Desc
clusterRelayPlumtreeReceivedIhaveTotal *prometheus.Desc
clusterRelayPlumtreeSentGraftTotal *prometheus.Desc
clusterRelayPlumtreeReceivedGraftTotal *prometheus.Desc
clusterRelayPlumtreeSentPruneTotal *prometheus.Desc
clusterRelayPlumtreeReceivedPruneTotal *prometheus.Desc
clusterRelayPlumtreeGraftMissTotal *prometheus.Desc
clusterRelayPlumtreeSkippedSendTotal *prometheus.Desc
clusterRelayPlumtreeIgnoredTotal *prometheus.Desc
}

func (m *SoraClusterMetrics) Describe(ch chan<- *prometheus.Desc) {
Expand All @@ -65,6 +67,7 @@ func (m *SoraClusterMetrics) Describe(ch chan<- *prometheus.Desc) {
ch <- m.clusterRelaySentPacketsTotal
ch <- m.clusterRelayPlumtreeSentGossipTotal
ch <- m.clusterRelayPlumtreeReceivedGossipTotal
ch <- m.clusterRelayPlumtreeReceivedGossipHopTotal
ch <- m.clusterRelayPlumtreeSentIhaveTotal
ch <- m.clusterRelayPlumtreeReceivedIhaveTotal
ch <- m.clusterRelayPlumtreeSentGraftTotal
Expand Down Expand Up @@ -106,6 +109,7 @@ func (m *SoraClusterMetrics) Collect(ch chan<- prometheus.Metric, nodeList []sor

ch <- newCounter(m.clusterRelayPlumtreeSentGossipTotal, float64(relayNode.Plumtree.TotalSentGossip), relayNode.NodeName)
ch <- newCounter(m.clusterRelayPlumtreeReceivedGossipTotal, float64(relayNode.Plumtree.TotalReceivedGossip), relayNode.NodeName)
ch <- newCounter(m.clusterRelayPlumtreeReceivedGossipHopTotal, float64(relayNode.Plumtree.TotalReceivedGossipHop), relayNode.NodeName)
ch <- newCounter(m.clusterRelayPlumtreeSentIhaveTotal, float64(relayNode.Plumtree.TotalSentIhave), relayNode.NodeName)
ch <- newCounter(m.clusterRelayPlumtreeReceivedIhaveTotal, float64(relayNode.Plumtree.TotalReceivedIhave), relayNode.NodeName)
ch <- newCounter(m.clusterRelayPlumtreeSentGraftTotal, float64(relayNode.Plumtree.TotalSentGraft), relayNode.NodeName)
Expand Down
23 changes: 12 additions & 11 deletions collector/sora_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,17 +179,18 @@ type soraClusterRelay struct {
}

type soraClusterRelayPlumtree struct {
TotalSentGossip int64 `json:"total_sent_gossip"`
TotalReceivedGossip int64 `json:"total_received_gossip"`
TotalSentIhave int64 `json:"total_sent_ihave"`
TotalReceivedIhave int64 `json:"total_received_ihave"`
TotalSentGraft int64 `json:"total_sent_graft"`
TotalReceivedGraft int64 `json:"total_received_graft"`
TotalSentPrune int64 `json:"total_sent_prune"`
TotalReceivedPrune int64 `json:"total_received_prune"`
TotalGraftMiss int64 `json:"total_graft_miss"`
TotalSkippedSend int64 `json:"total_skipped_send"`
TotalIgnored int64 `json:"total_ignored"`
TotalSentGossip int64 `json:"total_sent_gossip"`
TotalReceivedGossip int64 `json:"total_received_gossip"`
TotalReceivedGossipHop int64 `json:"total_received_gossip_hop"`
TotalSentIhave int64 `json:"total_sent_ihave"`
TotalReceivedIhave int64 `json:"total_received_ihave"`
TotalSentGraft int64 `json:"total_sent_graft"`
TotalReceivedGraft int64 `json:"total_received_graft"`
TotalSentPrune int64 `json:"total_sent_prune"`
TotalReceivedPrune int64 `json:"total_received_prune"`
TotalGraftMiss int64 `json:"total_graft_miss"`
TotalSkippedSend int64 `json:"total_skipped_send"`
TotalIgnored int64 `json:"total_ignored"`
}

type soraLicenseInfo struct {
Expand Down

0 comments on commit 12dd98b

Please sign in to comment.