Skip to content

Commit

Permalink
fix: workload and workload_volume templates should invoke the instanc…
Browse files Browse the repository at this point in the history
…e task before the data task.
  • Loading branch information
rahulguptajss committed Feb 28, 2025
1 parent bc787f7 commit 76fe0a5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
21 changes: 11 additions & 10 deletions cmd/collectors/restperf/restperf.go
Original file line number Diff line number Diff line change
Expand Up @@ -1519,18 +1519,19 @@ func (r *RestPerf) PollInstance() (map[string]*matrix.Matrix, error) {
records []gjson.Result
)

dataQuery := path.Join(r.Prop.Query, "rows")
fields := "properties"
// The PollInstance method is only needed for `workload` and `workload_detail` objects.
if !(isWorkloadObject(r.Prop.Query) || isWorkloadDetailObject(r.Prop.Query)) {
return nil, nil
}

var filter []string

if isWorkloadObject(r.Prop.Query) || isWorkloadDetailObject(r.Prop.Query) {
fields = "*"
dataQuery = qosWorkloadQuery
if r.Prop.Query == qosVolumeQuery || r.Prop.Query == qosDetailVolumeQuery {
filter = append(filter, "workload_class="+r.loadWorkloadClassQuery(objWorkloadVolumeClass))
} else {
filter = append(filter, "workload_class="+r.loadWorkloadClassQuery(objWorkloadClass))
}
fields := "*"
dataQuery := qosWorkloadQuery
if r.Prop.Query == qosVolumeQuery || r.Prop.Query == qosDetailVolumeQuery {
filter = append(filter, "workload_class="+r.loadWorkloadClassQuery(objWorkloadVolumeClass))
} else {
filter = append(filter, "workload_class="+r.loadWorkloadClassQuery(objWorkloadClass))
}

r.pollInstanceCalls++
Expand Down
2 changes: 1 addition & 1 deletion conf/restperf/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ collector: RestPerf
# Order here matters!
schedule:
- counter: 24h
- instance: 720h # This is only needed for `workload` and `workload_volume` templates, which overwrite this value in their own templates.
- data: 1m

objects:
Expand Down Expand Up @@ -55,6 +56,5 @@ objects:
Vscan: vscan.yaml
VscanSVM: vscan_svm.yaml

# Uncomment to collect workload/QOS counters.
Workload: workload.yaml
WorkloadVolume: workload_volume.yaml
1 change: 0 additions & 1 deletion conf/zapiperf/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,5 @@ objects:
Vscan: vscan.yaml
VscanSVM: vscan_svm.yaml

# Uncomment to collect workload/QOS counters.
Workload: workload.yaml
WorkloadVolume: workload_volume.yaml

0 comments on commit 76fe0a5

Please sign in to comment.