mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-07 02:56:35 +00:00
fix collectServerSession func
Signed-off-by: Andrey Burtasov <BurtasovAA@GSP-I.RU>
This commit is contained in:
@@ -183,6 +183,7 @@ func (c *collector) collectServerShares(ctx *types.ScrapeContext, ch chan<- prom
|
|||||||
|
|
||||||
// Perflib: SMB Server Sessions
|
// Perflib: SMB Server Sessions
|
||||||
type perflibServerSession struct {
|
type perflibServerSession struct {
|
||||||
|
Name string
|
||||||
TreeConnectCount float64 `perflib:"Tree Connect Count"`
|
TreeConnectCount float64 `perflib:"Tree Connect Count"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,6 +194,10 @@ func (c *collector) collectServerSessions(ctx *types.ScrapeContext, ch chan<- pr
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, instance := range data {
|
for _, instance := range data {
|
||||||
|
labelName := c.toLabelName(instance.Name)
|
||||||
|
if !strings.HasSuffix(labelName, "_total") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.TreeConnectCount,
|
c.TreeConnectCount,
|
||||||
|
|||||||
Reference in New Issue
Block a user