Skip to content

Commit

Permalink
feat: Harvest should remove Service Center metrics (#3019)
Browse files Browse the repository at this point in the history
* feat: Harvest should remove Service Center metrics
  • Loading branch information
rahulguptajss committed Jul 1, 2024
1 parent 9adca33 commit 41c602f
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 1,571 deletions.
6 changes: 5 additions & 1 deletion cmd/collectors/restperf/restperf.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var qosDetailQuery = "api/cluster/counter/tables/qos_detail"
var qosDetailVolumeQuery = "api/cluster/counter/tables/qos_detail_volume"
var qosWorkloadQuery = "api/storage/qos/workloads"

var workloadDetailMetrics = []string{"resource_latency", "service_time_latency"}
var workloadDetailMetrics = []string{"resource_latency"}

var qosQueries = map[string]string{
qosQuery: qosQuery,
Expand Down Expand Up @@ -171,6 +171,10 @@ func (r *RestPerf) InitQOS() error {
if withConstituents == "false" {
r.perfProp.disableConstituents = true
}
withServiceLatency := refine.GetChildContentS("with_service_latency")
if withServiceLatency != "false" {
workloadDetailMetrics = append(workloadDetailMetrics, "service_time_latency")
}
}
}
return nil
Expand Down
17 changes: 16 additions & 1 deletion cmd/collectors/zapiperf/zapiperf.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const (
BILLION = 1_000_000_000
)

var workloadDetailMetrics = []string{"resource_latency", "service_time_latency"}
var workloadDetailMetrics = []string{"resource_latency"}

type ZapiPerf struct {
*zapi.Zapi // provides: AbstractCollector, Client, Object, Query, TemplateFn, TemplateType
Expand Down Expand Up @@ -119,10 +119,25 @@ func (z *ZapiPerf) Init(a *collector.AbstractCollector) error {
return err
}

z.InitQOS()

z.Logger.Debug().Msg("initialized")
return nil
}

func (z *ZapiPerf) InitQOS() {
counters := z.Params.GetChildS("counters")
if counters != nil {
refine := counters.GetChildS("refine")
if refine != nil {
withServiceLatency := refine.GetChildContentS("with_service_latency")
if withServiceLatency != "false" {
workloadDetailMetrics = append(workloadDetailMetrics, "service_time_latency")
}
}
}
}

func (z *ZapiPerf) LoadPlugin(kind string, abc *plugin.AbstractPlugin) plugin.Plugin {
switch kind {
case "Nic":
Expand Down
1 change: 1 addition & 0 deletions conf/restperf/9.12.0/workload_detail.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ counters:
- wait_time
- refine:
- with_constituents: false # The possible values are true or false. Setting this to true will include constituents in the results, while false will exclude them.
- with_service_latency: false # The possible values are true or false. Setting this to true will generate metric qos_detail_service_time_latency which is average service time for workload within the subsystems. This latency is the processing time within the subsystem.

resource_map:
CPU_dblade: backend
Expand Down
1 change: 1 addition & 0 deletions conf/restperf/9.12.0/workload_detail_volume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ counters:
- wait_time
- refine:
- with_constituents: false # The possible values are true or false. Setting this to true will include constituents in the results, while false will exclude them.
- with_service_latency: false # The possible values are true or false. Setting this to true will generate metric qos_detail_service_time_latency which is average service time for workload within the subsystems. This latency is the processing time within the subsystem.

resource_map:
CPU_dblade : backend
Expand Down
1 change: 1 addition & 0 deletions conf/zapiperf/cdot/9.8.0/workload_detail.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ counters:
- wait_time
- refine:
- with_constituents: false # The possible values are true or false. Setting this to true will include constituents in the results, while false will exclude them.
- with_service_latency: false # The possible values are true or false. Setting this to true will generate metric qos_detail_service_time_latency which is average service time for workload within the subsystems. This latency is the processing time within the subsystem.

resource_map:
CPU_dblade: backend
Expand Down
1 change: 1 addition & 0 deletions conf/zapiperf/cdot/9.8.0/workload_detail_volume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ counters:
- wait_time
- refine:
- with_constituents: false # The possible values are true or false. Setting this to true will include constituents in the results, while false will exclude them.
- with_service_latency: false # The possible values are true or false. Setting this to true will generate metric qos_detail_service_time_latency which is average service time for workload within the subsystems. This latency is the processing time within the subsystem.

resource_map:
CPU_dblade : backend
Expand Down
Loading

0 comments on commit 41c602f

Please sign in to comment.