Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iis: fix panic #1820

Merged
merged 1 commit into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/collector/iis/iis_w3svc_w3wp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
14 changes: 7 additions & 7 deletions internal/collector/vmware/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
14 changes: 7 additions & 7 deletions internal/collector/vmware/vmware.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading