iis: fix panic (#1820)

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2024-12-22 13:13:25 +01:00
committed by GitHub
parent a9f8b3b722
commit 78386557d4
3 changed files with 15 additions and 15 deletions

View File

@@ -405,7 +405,7 @@ func (c *Collector) collectW3SVCW3WP(ch chan<- prometheus.Metric) error {
}
func (c *Collector) collectW3SVCW3WPv8(ch chan<- prometheus.Metric) error {
err := c.w3SVCW3WPPerfDataCollector.Collect(&c.perfDataObjectW3SVCW3WPV8)
err := c.w3SVCW3WPPerfDataCollectorV8.Collect(&c.perfDataObjectW3SVCW3WPV8)
if err != nil {
return fmt.Errorf("failed to collect APP_POOL_WAS metrics: %w", err)
}

View File

@@ -16,13 +16,13 @@
package vmware
type perfDataCounterValuesCPU struct {
CouEffectiveVMSpeedMHz float64 `perfdata:"Effective VM Speed in MHz"` // \VM Processor(*)\Effective VM Speed in MHz
CpuHostProcessorSpeedMHz float64 `perfdata:"Host processor speed in MHz"` // \VM Processor(*)\Host processor speed in MHz
CpuLimitMHz float64 `perfdata:"Limit in MHz"` // \VM Processor(*)\Limit in MHz
CpuReservationMHz float64 `perfdata:"Reservation in MHz"` // \VM Processor(*)\Reservation in MHz
CpuShares float64 `perfdata:"Shares"` // \VM Processor(*)\Shares
CpuStolenMs float64 `perfdata:"CPU stolen time"` // \VM Processor(*)\CPU stolen time
CpuTimePercents float64 `perfdata:"% Processor Time"` // \VM Processor(*)\% Processor Time
CPUEffectiveVMSpeedMHz float64 `perfdata:"Effective VM Speed in MHz"` // \VM Processor(*)\Effective VM Speed in MHz
CPUHostProcessorSpeedMHz float64 `perfdata:"Host processor speed in MHz"` // \VM Processor(*)\Host processor speed in MHz
CPULimitMHz float64 `perfdata:"Limit in MHz"` // \VM Processor(*)\Limit in MHz
CPUReservationMHz float64 `perfdata:"Reservation in MHz"` // \VM Processor(*)\Reservation in MHz
CPUShares float64 `perfdata:"Shares"` // \VM Processor(*)\Shares
CPUStolenMs float64 `perfdata:"CPU stolen time"` // \VM Processor(*)\CPU stolen time
CPUTimePercents float64 `perfdata:"% Processor Time"` // \VM Processor(*)\% Processor Time
}
type perfDataCounterValuesMemory struct {

View File

@@ -330,43 +330,43 @@ func (c *Collector) collectCpu(ch chan<- prometheus.Metric) error {
ch <- prometheus.MustNewConstMetric(
c.cpuLimitMHz,
prometheus.GaugeValue,
c.perfDataObjectCPU[0].CpuLimitMHz,
c.perfDataObjectCPU[0].CPULimitMHz,
)
ch <- prometheus.MustNewConstMetric(
c.cpuReservationMHz,
prometheus.GaugeValue,
c.perfDataObjectCPU[0].CpuReservationMHz,
c.perfDataObjectCPU[0].CPUReservationMHz,
)
ch <- prometheus.MustNewConstMetric(
c.cpuShares,
prometheus.GaugeValue,
c.perfDataObjectCPU[0].CpuShares,
c.perfDataObjectCPU[0].CPUShares,
)
ch <- prometheus.MustNewConstMetric(
c.cpuStolenTotal,
prometheus.CounterValue,
utils.MilliSecToSec(c.perfDataObjectCPU[0].CpuStolenMs),
utils.MilliSecToSec(c.perfDataObjectCPU[0].CPUStolenMs),
)
ch <- prometheus.MustNewConstMetric(
c.cpuTimeTotal,
prometheus.CounterValue,
utils.MilliSecToSec(c.perfDataObjectCPU[0].CpuTimePercents),
utils.MilliSecToSec(c.perfDataObjectCPU[0].CPUTimePercents),
)
ch <- prometheus.MustNewConstMetric(
c.cpuEffectiveVMSpeedMHz,
prometheus.GaugeValue,
c.perfDataObjectCPU[0].CouEffectiveVMSpeedMHz,
c.perfDataObjectCPU[0].CPUEffectiveVMSpeedMHz,
)
ch <- prometheus.MustNewConstMetric(
c.hostProcessorSpeedMHz,
prometheus.GaugeValue,
c.perfDataObjectCPU[0].CpuHostProcessorSpeedMHz,
c.perfDataObjectCPU[0].CPUHostProcessorSpeedMHz,
)
return nil