Skip to content

Commit

Permalink
fix existing conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
kush-elastic committed Oct 1, 2024
1 parent 4b6842e commit 4224f72
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 276 deletions.
63 changes: 0 additions & 63 deletions metricbeat/module/vsphere/datastore/_meta/data.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,4 @@
{
<<<<<<< HEAD
"@timestamp": "2017-10-12T08:05:34.853Z",
"event": {
"dataset": "vsphere.datastore",
"duration": 115000,
"module": "vsphere"
},
"metricset": {
"name": "datastore",
"period": 10000
},
"service": {
"address": "127.0.0.1:33365",
"type": "vsphere"
},
"vsphere": {
"datastore": {
"iops": 0,
"host": {
"count": 1,
"names": [
"DC3_H0"
]
},
"status": "green",
"vm": {
"count": 6,
"names": [
"DC3_H0_VM0"
]
},
"read": {
"bytes": 0,
"latency": {
"total": {
"ms": 0
}
=======
"@timestamp": "2017-10-12T08:05:34.853Z",
"event": {
"dataset": "vsphere.datastore",
Expand Down Expand Up @@ -97,31 +59,6 @@
},
"fstype": "local",
"name": "LocalDS_0"
>>>>>>> 3f44bd1f9b ([Metricbeat][vSphere] New metrics support and minor changes to existing metricsets (#40766))
}
},
"write": {
"bytes": 337000,
"latency": {
"total": {
"ms": 0
}
}
},
"capacity": {
"free": {
"bytes": 37120094208
},
"total": {
"bytes": 74686664704
},
"used": {
"bytes": 37566570496,
"pct": 0.502988996026061
}
},
"fstype": "local",
"name": "LocalDS_0"
}
}
}
53 changes: 0 additions & 53 deletions metricbeat/module/vsphere/datastore/datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,56 +126,6 @@ func (m *DataStoreMetricSet) Fetch(ctx context.Context, reporter mb.ReporterV2)
for i := range dst {
if ctx.Err() != nil {
return ctx.Err()
<<<<<<< HEAD
default:
assetNames, err := getAssetNames(ctx, pc, &dst[i])
if err != nil {
m.Logger().Errorf("Failed to retrieve object from host %s: %w", dst[i].Name, err)
continue
}

spec := types.PerfQuerySpec{
Entity: dst[i].Reference(),
MetricId: metricIds,
MaxSample: 1,
IntervalId: 20, // right now we are only grabbing real time metrics from the performance manager
}

// Query performance data
samples, err := perfManager.Query(ctx, []types.PerfQuerySpec{spec})
if err != nil {
m.Logger().Debugf("Failed to query performance data for host %s: %v", dst[i].Name, err)
continue
}

if len(samples) == 0 {
m.Logger().Debugf("No samples returned from performance manager")
continue
}

results, err := perfManager.ToMetricSeries(ctx, samples)
if err != nil {
m.Logger().Debugf("Failed to query performance data to metric series for host %s: %v", dst[i].Name, err)
continue
}

metricMap := make(map[string]interface{})
for _, result := range results[0].Value {
if len(result.Value) > 0 {
metricMap[result.Name] = result.Value[0]
continue
}
m.Logger().Debugf("For host %s,Metric %v: No result found", dst[i].Name, result.Name)
}

reporter.Event(mb.Event{
MetricSetFields: m.mapEvent(dst[i], &metricData{
perfMetrics: metricMap,
assetNames: *assetNames,
}),
})
=======
>>>>>>> 3f44bd1f9b ([Metricbeat][vSphere] New metrics support and minor changes to existing metricsets (#40766))
}

assetNames, err := getAssetNames(ctx, pc, &dst[i])
Expand Down Expand Up @@ -246,8 +196,6 @@ func getAssetNames(ctx context.Context, pc *property.Collector, ds *mo.Datastore
outputVmNames: outputVmNames,
}, nil
}
<<<<<<< HEAD
=======

func (m *DataStoreMetricSet) getPerfMetrics(ctx context.Context, perfManager *performance.Manager, dst mo.Datastore, metrics map[string]*types.PerfCounterInfo) (metricMap map[string]interface{}, err error) {
metricMap = make(map[string]interface{})
Expand Down Expand Up @@ -317,4 +265,3 @@ func (m *DataStoreMetricSet) getPerfMetrics(ctx context.Context, perfManager *pe

return metricMap, nil
}
>>>>>>> 3f44bd1f9b ([Metricbeat][vSphere] New metrics support and minor changes to existing metricsets (#40766))
4 changes: 0 additions & 4 deletions metricbeat/module/vsphere/fields.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions metricbeat/module/vsphere/host/_meta/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,7 @@
"vm": {
"count": 2,
"names": [
<<<<<<< HEAD
"DC0_H0_VM0",
=======
"DC0_H0_VM0",
>>>>>>> 3f44bd1f9b ([Metricbeat][vSphere] New metrics support and minor changes to existing metricsets (#40766))
"DC0_H0_VM1"
]
},
Expand All @@ -134,10 +130,6 @@
"LocalDS_0"
]
},
<<<<<<< HEAD
"network_count": 1,
=======
>>>>>>> 3f44bd1f9b ([Metricbeat][vSphere] New metrics support and minor changes to existing metricsets (#40766))
"network_names": [
"VM Network"
],
Expand Down
48 changes: 0 additions & 48 deletions metricbeat/module/vsphere/host/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,51 +140,6 @@ func (m *HostMetricSet) Fetch(ctx context.Context, reporter mb.ReporterV2) error
for i := range hst {
if ctx.Err() != nil {
return ctx.Err()
<<<<<<< HEAD
default:
assetNames, err := getAssetNames(ctx, pc, &hst[i])
if err != nil {
m.Logger().Errorf("Failed to retrieve object from host %s: %w", hst[i].Name, err)
}

spec := types.PerfQuerySpec{
Entity: hst[i].Reference(),
MetricId: metricIds,
MaxSample: 1,
IntervalId: 20, // right now we are only grabbing real time metrics from the performance manager
}

// Query performance data
samples, err := perfManager.Query(ctx, []types.PerfQuerySpec{spec})
if err != nil {
m.Logger().Errorf("Failed to query performance data from host %s: %v", hst[i].Name, err)
continue
}

if len(samples) == 0 {
m.Logger().Debug("No samples returned from performance manager")
continue
}

results, err := perfManager.ToMetricSeries(ctx, samples)
if err != nil {
m.Logger().Errorf("Failed to convert performance data to metric series for host %s: %v", hst[i].Name, err)
}

metricMap := make(map[string]interface{})
for _, result := range results[0].Value {
if len(result.Value) > 0 {
metricMap[result.Name] = result.Value[0]
continue
}
m.Logger().Debugf("For host %s,Metric %v: No result found", hst[i].Name, result.Name)
}

reporter.Event(mb.Event{
MetricSetFields: m.mapEvent(hst[i], &metricData{perfMetrics: metricMap, assetNames: assetNames}),
})
=======
>>>>>>> 3f44bd1f9b ([Metricbeat][vSphere] New metrics support and minor changes to existing metricsets (#40766))
}
assetNames, err := getAssetNames(ctx, pc, &hst[i])
if err != nil {
Expand Down Expand Up @@ -248,8 +203,6 @@ func getAssetNames(ctx context.Context, pc *property.Collector, hs *mo.HostSyste
outputVmNames: outputVmNames,
}, nil
}
<<<<<<< HEAD
=======

func (m *HostMetricSet) getPerfMetrics(ctx context.Context, perfManager *performance.Manager, hst mo.HostSystem, metrics map[string]*types.PerfCounterInfo) (metricMap map[string]interface{}, err error) {
metricMap = make(map[string]interface{})
Expand Down Expand Up @@ -319,4 +272,3 @@ func (m *HostMetricSet) getPerfMetrics(ctx context.Context, perfManager *perform

return metricMap, nil
}
>>>>>>> 3f44bd1f9b ([Metricbeat][vSphere] New metrics support and minor changes to existing metricsets (#40766))
72 changes: 0 additions & 72 deletions metricbeat/module/vsphere/virtualmachine/_meta/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,77 +15,6 @@
},
"vsphere": {
"virtualmachine": {
<<<<<<< HEAD
"network.names": [
"PROD_VCF"
],
"os": "Microsoft Windows 10 (64-bit)",
"datastore": {
"count": 1
},
"memory": {
"used": {
"guest": {
"bytes": 0
},
"host": {
"bytes": 0
}
},
"total": {
"guest": {
"bytes": 4294967296
}
},
"free": {
"guest": {
"bytes": 4294967296
}
}
},
"network": {
"count": 1
},
"host.hostname": "phx-w1c1",
"name": "phx-14",
"cpu": {
"free": {
"mhz": 0
},
"used": {
"mhz": 0
},
"total": {
"mhz": 0
}
},
"uptime": 0,
"status": "green",
"network_names": [
"PROD_VCF"
],
"datastore.names": [
"VxRailtec-Virtual-SAN-Datastore-247df-bc1d-5aad2"
],
"host.id": "host-20",
"snapshot.info": [
{
"Name": "Snapshot_1",
"Description": "Test snapshot 1",
"CreateTime": "2024-09-01T12:34:56Z"

},
{
"Name": "Snapshot_2",
"Description": "Test snapshot 2",
"CreateTime": "2024-09-03T2:34:56Z"
}
],
"snapshot.count": 2
}
}
}
=======
"name": "xt0nmfpv9",
"uptime": 5348978,
"status": "green",
Expand Down Expand Up @@ -162,4 +91,3 @@
}
}
}
>>>>>>> 3f44bd1f9b ([Metricbeat][vSphere] New metrics support and minor changes to existing metricsets (#40766))
20 changes: 0 additions & 20 deletions metricbeat/module/vsphere/virtualmachine/data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,25 +122,6 @@ func TestEventMapping(t *testing.T) {
"customField1": "value1",
"customField2": "value2",
},
<<<<<<< HEAD
"network.names": []string{"network-1", "network-2"},
"network_names": []string{"network-1", "network-2"},
"datastore.names": []string{"ds1", "ds2"},
"snapshot.info": []VMSnapshotData{
{
ID: 123,
Name: "Snapshot_1",
Description: "Test snapshot 1",
CreateTime: time.Time{},
State: types.VirtualMachinePowerStatePoweredOff,
},
{
ID: 745,
Name: "Snapshot_2",
Description: "Test snapshot 2",
CreateTime: time.Time{},
State: types.VirtualMachinePowerStatePoweredOn,
=======
"network_names": []string{"network-1", "network-2"},
"snapshot": mapstr.M{
"info": []VMSnapshotData{
Expand All @@ -158,7 +139,6 @@ func TestEventMapping(t *testing.T) {
CreateTime: common.Time{},
State: types.VirtualMachinePowerStatePoweredOn,
},
>>>>>>> 3f44bd1f9b ([Metricbeat][vSphere] New metrics support and minor changes to existing metricsets (#40766))
},
},
"snapshot.count": 2,
Expand Down
8 changes: 0 additions & 8 deletions metricbeat/module/vsphere/virtualmachine/virtualmachine.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,11 @@ type VMData struct {
}

type VMSnapshotData struct {
<<<<<<< HEAD
ID int32
Name string
Description string
CreateTime time.Time
State types.VirtualMachinePowerState
=======
ID int32 `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
CreateTime common.Time `json:"createtime"`
State types.VirtualMachinePowerState `json:"state"`
>>>>>>> 3f44bd1f9b ([Metricbeat][vSphere] New metrics support and minor changes to existing metricsets (#40766))
}

// New creates a new instance of the MetricSet.
Expand Down

0 comments on commit 4224f72

Please sign in to comment.