Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add workload panels in workload dashboard #2100

Merged
merged 35 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
9c12d51
feat: add workload panels in workload dashboard
rahulguptajss May 19, 2023
6443fbe
feat: add workload panels in workload dashboard
rahulguptajss May 19, 2023
b4703ff
Merge branch 'main' into rg2-workload-dash
rahulguptajss May 22, 2023
4d5b123
feat: workload dashboard
rahulguptajss May 23, 2023
a988bee
feat: workload dashboard
rahulguptajss May 23, 2023
104925d
feat: workload dashboard
rahulguptajss May 25, 2023
56cc6ca
feat: workload dashboard
rahulguptajss May 25, 2023
55503b9
Merge branch 'main' into rg2-workload-dash
rahulguptajss May 30, 2023
73c059e
feat: workload dashboard changes
rahulguptajss May 30, 2023
7beda41
feat: workload dashboard changes
rahulguptajss May 30, 2023
ee6c1b6
Merge branch 'main' into rg2-workload-dash
rahulguptajss Jun 13, 2023
5e4c10c
feat: make workload_class configurable
rahulguptajss Jun 14, 2023
fffd388
Merge branch 'main' into rg2-workload-dash
cgrinds Jul 19, 2023
fdaeac1
Merge remote-tracking branch 'origin/main' into rg2-workload-dash
rahulguptajss Jul 26, 2023
fa508c0
feat: add workload panels
rahulguptajss Jul 26, 2023
1f3a7ec
feat: add workload panels
rahulguptajss Jul 26, 2023
61f3af0
feat: add workload panels
rahulguptajss Jul 26, 2023
8d60d3f
feat: add workload panels
rahulguptajss Jul 26, 2023
7347639
feat: add workload panels
rahulguptajss Jul 26, 2023
a4a38cc
feat: add workload panels
rahulguptajss Jul 28, 2023
38adfdb
Merge remote-tracking branch 'origin/main' into rg2-workload-dash
rahulguptajss Jul 28, 2023
9f528e9
feat: add workload panels
rahulguptajss Jul 28, 2023
c0f0c5e
Merge remote-tracking branch 'origin/main' into rg2-workload-dash
rahulguptajss Jul 31, 2023
62307f4
feat: add service center view
rahulguptajss Aug 1, 2023
7486a7c
feat: add service center view
rahulguptajss Aug 1, 2023
2513a1b
feat: add service center view
rahulguptajss Aug 1, 2023
fa095d7
feat: add service center view
rahulguptajss Aug 1, 2023
f35e155
Merge remote-tracking branch 'origin/main' into rg2-workload-dash
rahulguptajss Aug 4, 2023
8e940e9
feat: add comments for detail workload
rahulguptajss Aug 4, 2023
ec74b50
feat: add comments for detail workload
rahulguptajss Aug 8, 2023
62836d9
feat: address review comments
rahulguptajss Aug 9, 2023
9f35b44
feat: address review comments
rahulguptajss Aug 9, 2023
dda803c
feat: address review comments
rahulguptajss Aug 9, 2023
04ee524
feat: address review comments
rahulguptajss Aug 9, 2023
df4c7db
feat: remove workload class from templates
rahulguptajss Aug 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 29 additions & 5 deletions cmd/collectors/restperf/restperf.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/netapp/harvest/v2/pkg/errs"
"github.com/netapp/harvest/v2/pkg/matrix"
"github.com/netapp/harvest/v2/pkg/set"
"github.com/netapp/harvest/v2/pkg/tree/node"
"github.com/netapp/harvest/v2/pkg/util"
"github.com/tidwall/gjson"
"path"
Expand All @@ -28,9 +29,11 @@ import (
)

const (
latencyIoReqd = 10
BILLION = 1_000_000_000
arrayKeyToken = "#"
latencyIoReqd = 10
BILLION = 1_000_000_000
arrayKeyToken = "#"
objWorkloadClass = "user_defined|system_defined"
objWorkloadVolumeClass = "autovolume"
)

var qosQuery = "api/cluster/counter/tables/qos"
Expand Down Expand Up @@ -171,6 +174,27 @@ func (r *RestPerf) InitMatrix() error {
return nil
}

// load workload_class or use defaultValue
func (r *RestPerf) loadWorkloadClassQuery(defaultValue string) string {

var x *node.Node

name := "workload_class"

if x = r.Params.GetChildS(name); x != nil {
v := x.GetAllChildContentS()
if len(v) == 0 {
r.Logger.Debug().Msgf("using %s = [%s] (default)", name, defaultValue)
rahulguptajss marked this conversation as resolved.
Show resolved Hide resolved
return defaultValue
}
s := strings.Join(v, "|")
r.Logger.Debug().Msgf("using %s = [%s]", name, s)
rahulguptajss marked this conversation as resolved.
Show resolved Hide resolved
return s
}
r.Logger.Debug().Msgf("using %s = [%s] (default)", name, defaultValue)
rahulguptajss marked this conversation as resolved.
Show resolved Hide resolved
return defaultValue
}

// load an int parameter or use defaultValue
func (r *RestPerf) loadParamInt(name string, defaultValue int) int {

Expand Down Expand Up @@ -1255,9 +1279,9 @@ func (r *RestPerf) PollInstance() (map[string]*matrix.Matrix, error) {
fields = "*"
dataQuery = qosWorkloadQuery
if r.Prop.Query == qosVolumeQuery || r.Prop.Query == qosDetailVolumeQuery {
filter = append(filter, "workload-class=autovolume|user_defined|system_defined")
filter = append(filter, "workload_class="+r.loadWorkloadClassQuery(objWorkloadVolumeClass))
} else {
filter = append(filter, "workload-class=user_defined|system_defined")
filter = append(filter, "workload_class="+r.loadWorkloadClassQuery(objWorkloadClass))
}
}

Expand Down
27 changes: 25 additions & 2 deletions cmd/collectors/zapiperf/zapiperf.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ const (
objWorkloadDetail = "workload_detail"
objWorkloadVolume = "workload_volume"
objWorkloadDetailVolume = "workload_detail_volume"
objWorkloadClass = "user_defined|system_defined"
objWorkloadVolumeClass = "autovolume"
BILLION = 1_000_000_000
)

Expand Down Expand Up @@ -172,6 +174,27 @@ func (z *ZapiPerf) loadParamStr(name, defaultValue string) string {
return defaultValue
}

// load workload_class or use defaultValue
func (z *ZapiPerf) loadWorkloadClassQuery(defaultValue string) string {

var x *node.Node

name := "workload_class"

if x = z.Params.GetChildS(name); x != nil {
v := x.GetAllChildContentS()
if len(v) == 0 {
z.Logger.Debug().Msgf("using %s = [%s] (default)", name, defaultValue)
rahulguptajss marked this conversation as resolved.
Show resolved Hide resolved
return defaultValue
}
s := strings.Join(v, "|")
z.Logger.Debug().Msgf("using %s = [%s]", name, s)
rahulguptajss marked this conversation as resolved.
Show resolved Hide resolved
return s
}
z.Logger.Debug().Msgf("using %s = [%s] (default)", name, defaultValue)
rahulguptajss marked this conversation as resolved.
Show resolved Hide resolved
return defaultValue
}

// load an int parameter or use defaultValue
func (z *ZapiPerf) loadParamInt(name string, defaultValue int) int {

Expand Down Expand Up @@ -1318,9 +1341,9 @@ func (z *ZapiPerf) PollInstance() (map[string]*matrix.Matrix, error) {
queryElem := request.NewChildS("query", "")
infoElem := queryElem.NewChildS("qos-workload-info", "")
if z.Query == objWorkloadVolume || z.Query == objWorkloadDetailVolume {
infoElem.NewChildS("workload-class", "autovolume|user_defined|system_defined")
infoElem.NewChildS("workload-class", z.loadWorkloadClassQuery(objWorkloadVolumeClass))
} else {
infoElem.NewChildS("workload-class", "user_defined|system_defined")
infoElem.NewChildS("workload-class", z.loadWorkloadClassQuery(objWorkloadClass))
}

instancesAttr = "attributes-list"
Expand Down
14 changes: 0 additions & 14 deletions cmd/tools/generate/counter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -475,20 +475,6 @@ counters:
Template: conf/zapiperf/9.12.0/workload_detail.yaml
Unit: microseconds

- Name: qos_detail_volume_resource_latency
Description: average latency for volume on Data ONTAP subsystems
APIs:
- API: REST
Endpoint: api/cluster/counter/tables/qos_detail_volume
ONTAPCounter: Harvest generated
Template: conf/restperf/9.12.0/workload_detail_volume.yaml
Unit: microseconds
- API: ZAPI
Endpoint: perf-object-get-instances workload_detail_volume
ONTAPCounter: Harvest generated
Template: conf/zapiperf/9.12.0/workload_detail_volume.yaml
Unit: microseconds

- Name: quota_disk_limit
Description: Maximum amount of disk space, in kilobytes, allowed for the quota target
(hard disk space limit). The value is -1 if the limit is unlimited.
Expand Down
15 changes: 15 additions & 0 deletions conf/rest/9.12.0/qos_workload.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: QosWorkload
query: api/storage/qos/workloads
object: qos_workload

counters:
- ^^uuid => uuid
- ^name => workload
- ^workload_class => class

export_options:
instance_keys:
- uuid
instance_labels:
- class
- workload
1 change: 1 addition & 0 deletions conf/rest/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ objects:
OntapS3Policy: ontap_s3_policy.yaml
QosPolicyAdaptive: qos_policy_adaptive.yaml
QosPolicyFixed: qos_policy_fixed.yaml
QosWorkload: qos_workload.yaml
Qtree: qtree.yaml
Security: security.yaml
SecurityAccount: security_account.yaml
Expand Down
4 changes: 4 additions & 0 deletions conf/restperf/9.12.0/workload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ object: qos

# recommended to use large interval, since workload objects are expensive
client_timeout: 1m30s
workload_class:
- user_defined
- system_defined

schedule:
- counter: 1200s
- instance: 600s
Expand Down
4 changes: 4 additions & 0 deletions conf/restperf/9.12.0/workload_detail.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ object: qos_detail

# recommended to use large interval, since workload objects are expensive
client_timeout: 1m30s
workload_class:
- user_defined
- system_defined

schedule:
- counter: 1200s
- instance: 600s
Expand Down
5 changes: 4 additions & 1 deletion conf/restperf/9.12.0/workload_detail_volume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
# object provides latency breakdown per service or delay center per volume
name: WorkloadDetailVolume
query: api/cluster/counter/tables/qos_detail_volume
object: qos_detail_volume
object: qos_detail

# recommended to use large interval, since workload objects are expensive
client_timeout: 1m30s
workload_class:
- autovolume

schedule:
- counter: 1200s
- instance: 600s
Expand Down
5 changes: 4 additions & 1 deletion conf/restperf/9.12.0/workload_volume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@

name: WorkloadVolume
query: api/cluster/counter/tables/qos_volume
object: qos_volume
object: qos

# recommended to use large interval, since workload objects are expensive
client_timeout: 1m30s
workload_class:
- autovolume

schedule:
- counter: 1200s
- instance: 600s
Expand Down
18 changes: 18 additions & 0 deletions conf/zapi/cdot/9.8.0/qos_workload.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: QosWorkload
query: qos-workload-get-iter
object: qos_workload

counters:
qos-workload-info:
- ^^workload-uuid => uuid
- ^workload-class => class
- ^workload-name => workload

collect_only_labels: true

export_options:
instance_keys:
- uuid
instance_labels:
- class
- workload
1 change: 1 addition & 0 deletions conf/zapi/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ objects:
NtpServer: ntpserver.yaml
QosPolicyAdaptive: qos_policy_adaptive.yaml
QosPolicyFixed: qos_policy_fixed.yaml
QosWorkload: qos_workload.yaml
Qtree: qtree.yaml
Security: security.yaml
SecurityAccount: security_account.yaml
Expand Down
3 changes: 3 additions & 0 deletions conf/zapiperf/cdot/9.8.0/workload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ query: workload
object: qos

instance_key: uuid
workload_class:
rahulguptajss marked this conversation as resolved.
Show resolved Hide resolved
- user_defined
- system_defined

# recommended to use large interval, since workload objects are expensive
client_timeout: 1m30s
Expand Down
4 changes: 4 additions & 0 deletions conf/zapiperf/cdot/9.8.0/workload_detail.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ instance_key: name

# recommended to use a large interval, since workload objects are expensive
client_timeout: 1m30s
workload_class:
- user_defined
- system_defined

schedule:
- counter: 1200s
- instance: 600s
Expand Down
5 changes: 4 additions & 1 deletion conf/zapiperf/cdot/9.8.0/workload_detail_volume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
# object provides latency breakdown per service or delay center per volume
name: WorkloadDetailVolume
query: workload_detail_volume
object: qos_detail_volume
object: qos_detail

instance_key: name

# recommended to use a large interval, since workload objects are expensive
client_timeout: 1m30s
workload_class:
- autovolume

schedule:
- counter: 1200s
- instance: 600s
Expand Down
4 changes: 3 additions & 1 deletion conf/zapiperf/cdot/9.8.0/workload_volume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

name: WorkloadVolume
query: workload_volume
object: qos_volume
object: qos

# recommended to use large interval, since workload objects are expensive
client_timeout: 1m30s
Expand All @@ -14,6 +14,8 @@ schedule:
- data: 180s

instance_key: name
workload_class:
- autovolume

counters:
- instance_name
Expand Down
Loading