added code for rpx handling

This commit is contained in:
2025-08-19 20:20:18 +09:00
parent 31a4223aab
commit 10c139e837
19 changed files with 1518 additions and 427 deletions

View File

@ -11,6 +11,7 @@ type ClientCollector struct {
ClientRoutes *prometheus.Desc
ClientPeers *prometheus.Desc
PtySessions *prometheus.Desc
RptySessions *prometheus.Desc
}
// NewClientCollector returns a new ClientCollector with all prometheus.Desc initialized
@ -52,6 +53,11 @@ func NewClientCollector(client *Client) ClientCollector {
"Number of pty sessions",
nil, nil,
),
RptySessions: prometheus.NewDesc(
prefix + "rpty_sessions",
"Number of rpty sessions",
nil, nil,
),
}
}
@ -61,6 +67,7 @@ func (c ClientCollector) Describe(ch chan<- *prometheus.Desc) {
ch <- c.ClientRoutes
ch <- c.ClientPeers
ch <- c.PtySessions
ch <- c.RptySessions
}
func (c ClientCollector) Collect(ch chan<- prometheus.Metric) {
@ -97,4 +104,10 @@ func (c ClientCollector) Collect(ch chan<- prometheus.Metric) {
prometheus.GaugeValue,
float64(c.client.stats.pty_sessions.Load()),
)
ch <- prometheus.MustNewConstMetric(
c.RptySessions,
prometheus.GaugeValue,
float64(c.client.stats.rpty_sessions.Load()),
)
}