Skip to content

Commit eba21a4

Browse files
fix(deps): update module gopkg.in/yaml.v2 to v3
1 parent 390c25c commit eba21a4

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

go.mod

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/stretchr/testify v1.9.0
99
github.com/vmware/govmomi v0.36.3
1010
github.com/xeipuuv/gojsonschema v1.2.0
11-
gopkg.in/yaml.v2 v2.4.0
11+
gopkg.in/yaml.v3 v3.0.1
1212
)
1313

1414
require (
@@ -20,5 +20,4 @@ require (
2020
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
2121
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
2222
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
23-
gopkg.in/yaml.v3 v3.0.1 // indirect
2423
)

go.sum

-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9w
3434
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
3535
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
3636
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
37-
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
38-
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
3937
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
4038
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
4139
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

internal/performance/performance.go

+10-8
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"os"
1111
"strconv"
1212

13-
"gopkg.in/yaml.v2"
13+
"gopkg.in/yaml.v3"
1414

1515
logrus "github.com/sirupsen/logrus"
1616
"github.com/vmware/govmomi"
@@ -39,7 +39,7 @@ type PerfCollector struct {
3939
batchSizePerfMetrics int
4040
}
4141

42-
//this struct is not needed we can decide to pass more info and process it in the process, it would hide logic
42+
// this struct is not needed we can decide to pass more info and process it in the process, it would hide logic
4343
type PerfMetric struct {
4444
Value int64
4545
Counter string
@@ -126,11 +126,13 @@ func (c *PerfCollector) Collect(mos []types.ManagedObjectReference, metrics []ty
126126
}
127127

128128
// The metrics returned have a field indicating the 'instance' they refer to. However, that field could be empty in some cases.
129-
// Instance is an identifier that is derived from configuration names for the device associated with the metric.
130-
// It identifies the instance of the metric with its source. This property may be empty.
131-
// - For memory and aggregated statistics, this property is empty.
132-
// - For host and virtual machine devices, this property contains the name of the device, such as the name of the host-bus adapter or the name of the virtual Ethernet adapter. For example, “mpx.vmhba33:C0:T0:L0” or “vmnic0:”
133-
// - For a CPU, this property identifies the numeric position within the CPU core, such as 0, 1, 2, 3."""
129+
//
130+
// Instance is an identifier that is derived from configuration names for the device associated with the metric.
131+
// It identifies the instance of the metric with its source. This property may be empty.
132+
// - For memory and aggregated statistics, this property is empty.
133+
// - For host and virtual machine devices, this property contains the name of the device, such as the name of the host-bus adapter or the name of the virtual Ethernet adapter. For example, “mpx.vmhba33:C0:T0:L0” or “vmnic0:”
134+
// - For a CPU, this property identifies the numeric position within the CPU core, such as 0, 1, 2, 3."""
135+
//
134136
// We give priority to the values having the `instance` specified. If more than one value is returned we compute the average.
135137
// If no value having an 'instance' is found for a perf metric we fall back to 'instanceless' values.
136138
// If no value is returned we do not report that specific perf metric
@@ -307,7 +309,7 @@ type perfMetricsIDs struct {
307309
Datastore []types.PerfMetricId
308310
}
309311

310-
//This struct is used to parse the config file
312+
// This struct is used to parse the config file
311313
type ymlConfig struct {
312314
Host map[string][]string `yaml:"host"`
313315
VM map[string][]string `yaml:"vm"`

0 commit comments

Comments
 (0)