Skip to content

Commit

Permalink
Merge pull request #3303 from kbrock/historical_intervals
Browse files Browse the repository at this point in the history
Add default Historical Intervals to the simulator
  • Loading branch information
dougm authored Dec 8, 2023
2 parents aeb96b9 + 45188e1 commit dd6f792
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
14 changes: 14 additions & 0 deletions simulator/esx/performance_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@ package esx

import "github.com/vmware/govmomi/vim25/types"

// HistoricalInterval is the default template for the PerformanceManager historicalInterval property.
// Capture method:
//
// govc object.collect -s -dump PerformanceManager:ha-perfmgr historicalInterval
var HistoricalInterval = []types.PerfInterval{
{
Enabled: true,
Key: 1,
Length: 129600,
Name: "PastDay",
SamplingPeriod: 300,
},
}

// PerfCounter is the default template for the PerformanceManager perfCounter property.
// Capture method:
//
Expand Down
2 changes: 2 additions & 0 deletions simulator/performance_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@ type PerformanceManager struct {
func (m *PerformanceManager) init(r *Registry) {
if r.IsESX() {
m.PerfCounter = esx.PerfCounter
m.HistoricalInterval = esx.HistoricalInterval
m.hostMetrics = esx.HostMetrics
m.vmMetrics = esx.VmMetrics
m.rpMetrics = esx.ResourcePoolMetrics
m.metricData = esx.MetricData
} else {
m.PerfCounter = vpx.PerfCounter
m.HistoricalInterval = vpx.HistoricalInterval
m.hostMetrics = vpx.HostMetrics
m.vmMetrics = vpx.VmMetrics
m.rpMetrics = vpx.ResourcePoolMetrics
Expand Down
39 changes: 39 additions & 0 deletions simulator/vpx/performance_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,45 @@ package vpx

import "github.com/vmware/govmomi/vim25/types"

// HistoricalInterval is the default template for the PerformanceManager historicalInterval property.
// Capture method:
//
// govc object.collect -s -dump PerformanceManager:Perfmgr historicalInterval
var HistoricalInterval = []types.PerfInterval{
{
Enabled: true,
Key: 1,
Length: 86400,
Level: 1,
Name: "Past Day",
SamplingPeriod: 300,
},
{
Enabled: true,
Key: 2,
Length: 604800,
Level: 1,
Name: "Past Week",
SamplingPeriod: 1800,
},
{
Enabled: true,
Key: 1,
Length: 2592000,
Level: 1,
Name: "Past Month",
SamplingPeriod: 7200,
},
{
Enabled: true,
Key: 1,
Length: 31536000,
Level: 1,
Name: "Past Year",
SamplingPeriod: 86400,
},
}

// PerfCounter is the default template for the PerformanceManager perfCounter property.
// Capture method:
// govc object.collect -s -dump PerformanceManager:PerfMgr perfCounter
Expand Down

0 comments on commit dd6f792

Please sign in to comment.