Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into hl_sm_source
Browse files Browse the repository at this point in the history
  • Loading branch information
Hardikl committed Oct 23, 2024
2 parents 41848d2 + 2397a2f commit af230e5
Show file tree
Hide file tree
Showing 10 changed files with 2,164 additions and 9 deletions.
21 changes: 12 additions & 9 deletions cmd/collectors/keyperf/keyperf.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ import (
)

const (
latencyIoReqd = 10
timestampMetricName = "statistics.timestamp"
latencyIoReqd = 10
)

type KeyPerf struct {
Expand All @@ -33,9 +32,10 @@ type counter struct {
}

type perfProp struct {
isCacheEmpty bool
counterInfo map[string]*counter
latencyIoReqd int
isCacheEmpty bool
counterInfo map[string]*counter
latencyIoReqd int
timestampMetricName string
}

func init() {
Expand Down Expand Up @@ -171,7 +171,8 @@ func (kp *KeyPerf) buildCounters() {
counterType: "rate",
unit: "b_per_sec",
}
case strings.Contains(k, timestampMetricName):
case strings.Contains(k, "timestamp"):
kp.perfProp.timestampMetricName = k
ctr = &counter{
name: k,
counterType: "delta",
Expand Down Expand Up @@ -346,9 +347,11 @@ func (kp *KeyPerf) pollData(
}
}

timestamp := curMat.GetMetric(timestampMetricName)
timestamp := curMat.GetMetric(kp.perfProp.timestampMetricName)
if timestamp != nil {
timestamp.SetExportable(false)
} else {
return nil, errs.New(errs.ErrConfig, "missing timestamp metric")
}
err = kp.validateMatrix(prevMat, curMat)
if err != nil {
Expand Down Expand Up @@ -427,7 +430,7 @@ func (kp *KeyPerf) pollData(
if property == "average" || property == "percent" {

if strings.HasSuffix(metric.GetName(), "latency") {
skips, err = curMat.DivideWithThreshold(key, counter.denominator, kp.perfProp.latencyIoReqd, cachedData, prevMat, timestampMetricName, kp.Logger)
skips, err = curMat.DivideWithThreshold(key, counter.denominator, kp.perfProp.latencyIoReqd, cachedData, prevMat, kp.perfProp.timestampMetricName, kp.Logger)
} else {
skips, err = curMat.Divide(key, counter.denominator)
}
Expand Down Expand Up @@ -470,7 +473,7 @@ func (kp *KeyPerf) pollData(
}
property := counter.counterType
if property == "rate" {
if skips, err = curMat.Divide(orderedKeys[i], timestampMetricName); err != nil {
if skips, err = curMat.Divide(orderedKeys[i], kp.perfProp.timestampMetricName); err != nil {
kp.Logger.Error(
"Calculate rate",
slogx.Err(err),
Expand Down
29 changes: 29 additions & 0 deletions conf/keyperf/9.15.0/nfsv3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: NFSv3
query: api/protocols/nfs/services
object: svm_nfs

global_labels:
- nfsv: v3

counters:
- ^^svm.uuid => uuid
- ^statistics.v3.status => status
- ^svm.name => svm
- statistics.v3.iops_raw.other => other_ops
- statistics.v3.iops_raw.read => read_ops
- statistics.v3.iops_raw.total => ops
- statistics.v3.iops_raw.write => write_ops
- statistics.v3.latency_raw.other => other_latency
- statistics.v3.latency_raw.read => read_avg_latency
- statistics.v3.latency_raw.total => latency
- statistics.v3.latency_raw.write => write_avg_latency
- statistics.v3.throughput_raw.read => read_throughput
- statistics.v3.throughput_raw.total => total_throughput
- statistics.v3.throughput_raw.write => write_throughput
- statistics.v3.timestamp(timestamp) => timestamp
- hidden_fields:
- statistics.v3

export_options:
instance_keys:
- svm
29 changes: 29 additions & 0 deletions conf/keyperf/9.15.0/nfsv4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: NFSv4
query: api/protocols/nfs/services
object: svm_nfs

global_labels:
- nfsv: v4

counters:
- ^^svm.uuid => uuid
- ^statistics.v4.status => status
- ^svm.name => svm
- statistics.v4.iops_raw.other => other_ops
- statistics.v4.iops_raw.read => read_ops
- statistics.v4.iops_raw.total => ops
- statistics.v4.iops_raw.write => write_ops
- statistics.v4.latency_raw.other => other_latency
- statistics.v4.latency_raw.read => read_avg_latency
- statistics.v4.latency_raw.total => latency
- statistics.v4.latency_raw.write => write_avg_latency
- statistics.v4.throughput_raw.read => read_throughput
- statistics.v4.throughput_raw.total => total_throughput
- statistics.v4.throughput_raw.write => write_throughput
- statistics.v4.timestamp(timestamp) => timestamp
- hidden_fields:
- statistics.v4

export_options:
instance_keys:
- svm
29 changes: 29 additions & 0 deletions conf/keyperf/9.15.0/nfsv4_1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: NFSv41
query: api/protocols/nfs/services
object: svm_nfs

global_labels:
- nfsv: v4.1

counters:
- ^^svm.uuid => uuid
- ^statistics.v41.status => status
- ^svm.name => svm
- statistics.v41.iops_raw.other => other_ops
- statistics.v41.iops_raw.read => read_ops
- statistics.v41.iops_raw.total => ops
- statistics.v41.iops_raw.write => write_ops
- statistics.v41.latency_raw.other => other_latency
- statistics.v41.latency_raw.read => read_avg_latency
- statistics.v41.latency_raw.total => latency
- statistics.v41.latency_raw.write => write_avg_latency
- statistics.v41.throughput_raw.read => read_throughput
- statistics.v41.throughput_raw.total => total_throughput
- statistics.v41.throughput_raw.write => write_throughput
- statistics.v41.timestamp(timestamp) => timestamp
- hidden_fields:
- statistics.v41

export_options:
instance_keys:
- svm
29 changes: 29 additions & 0 deletions conf/keyperf/9.15.0/nfsv4_2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: NFSv42
query: api/protocols/nfs/services
object: svm_nfs

global_labels:
- nfsv: v4.2

counters:
- ^^svm.uuid => uuid
- ^statistics.v42.status => status
- ^svm.name => svm
- statistics.v42.iops_raw.other => other_ops
- statistics.v42.iops_raw.read => read_ops
- statistics.v42.iops_raw.total => ops
- statistics.v42.iops_raw.write => write_ops
- statistics.v42.latency_raw.other => other_latency
- statistics.v42.latency_raw.read => read_avg_latency
- statistics.v42.latency_raw.total => latency
- statistics.v42.latency_raw.write => write_avg_latency
- statistics.v42.throughput_raw.read => read_throughput
- statistics.v42.throughput_raw.total => total_throughput
- statistics.v42.throughput_raw.write => write_throughput
- statistics.v42.timestamp(timestamp) => timestamp
- hidden_fields:
- statistics.v42

export_options:
instance_keys:
- svm
1 change: 1 addition & 0 deletions conf/keyperf/9.15.0/volume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ plugins:
# plugin will create summary/average for each object
# any names after the object names will be treated as label names that will be added to instances
- node
- svm<>svm_vol

export_options:
instance_keys:
Expand Down
4 changes: 4 additions & 0 deletions conf/keyperf/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ objects:
LIF: lif.yaml
Lun: lun.yaml
Namespace: namespace.yaml
NFSv3: nfsv3.yaml
NFSv41: nfsv4_1.yaml
NFSv42: nfsv4_2.yaml
NFSv4: nfsv4.yaml
Node: node.yaml
NvmeServices: nvme_services.yaml
Volume: volume.yaml
Expand Down
2 changes: 2 additions & 0 deletions conf/rest/9.12.0/snapmirror.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ endpoints:
- ^^destination.path => destination_location
- ^^uuid => relationship_id
- ^source.cluster.name => source_cluster
- ^state => relationship_state
- ^unhealthy_reason.#.message => last_transfer_error

plugins:
Expand Down Expand Up @@ -71,6 +72,7 @@ export_options:
- policy_type
- protectedBy
- protectionSourceType
- relationship_state
- relationship_status
- relationship_type
- schedule
Expand Down
2 changes: 2 additions & 0 deletions conf/zapi/cdot/9.8.0/snapmirror.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ counters:
- ^is-healthy => healthy
- ^last-transfer-error
- ^last-transfer-type
- ^mirror-state => relationship_state
- ^policy-type
- ^relationship-group-type => group_type
- ^relationship-status
Expand Down Expand Up @@ -55,6 +56,7 @@ export_options:
- policy_type
- protectedBy
- protectionSourceType
- relationship_state
- relationship_status
- relationship_type
- schedule
Expand Down
Loading

0 comments on commit af230e5

Please sign in to comment.