renamed pts to pty to avoid name collision

This commit is contained in:
2025-08-08 19:24:52 +09:00
parent 3fd91b2c45
commit d0f1663bf3
15 changed files with 470 additions and 298 deletions

View File

@ -11,7 +11,7 @@ type ServerCollector struct {
ServerRoutes *prometheus.Desc
ServerPeers *prometheus.Desc
SshProxySessions *prometheus.Desc
PtsSessions *prometheus.Desc
PtySessions *prometheus.Desc
}
// NewServerCollector returns a new ServerCollector with all prometheus.Desc initialized
@ -53,9 +53,9 @@ func NewServerCollector(server *Server) ServerCollector {
"Number of SSH proxy sessions",
nil, nil,
),
PtsSessions: prometheus.NewDesc(
prefix + "pts_sessions",
"Number of pts session",
PtySessions: prometheus.NewDesc(
prefix + "pty_sessions",
"Number of pty session",
nil, nil,
),
}
@ -67,7 +67,7 @@ func (c ServerCollector) Describe(ch chan<- *prometheus.Desc) {
ch <- c.ServerRoutes
ch <- c.ServerPeers
ch <- c.SshProxySessions
ch <- c.PtsSessions
ch <- c.PtySessions
}
func (c ServerCollector) Collect(ch chan<- prometheus.Metric) {
@ -106,8 +106,8 @@ func (c ServerCollector) Collect(ch chan<- prometheus.Metric) {
)
ch <- prometheus.MustNewConstMetric(
c.PtsSessions,
c.PtySessions,
prometheus.GaugeValue,
float64(c.server.stats.pts_sessions.Load()),
float64(c.server.stats.pty_sessions.Load()),
)
}