Skip to content

Commit

Permalink
feat: add parity for string types between RestPerf and ZapiPerf
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulguptajss authored and cgrinds committed Sep 5, 2023
1 parent c3a064b commit dc4e311
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cmd/collectors/restperf/restperf.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,20 @@ func (r *RestPerf) pollCounter(records []gjson.Result) (map[string]*matrix.Matri
}

name := strings.Clone(c.Get("name").String())
dataType := strings.Clone(c.Get("type").String())
if p := r.GetOverride(name); p != "" {
dataType = p
}

if _, has := r.Prop.Metrics[name]; has {
if strings.Contains(dataType, "string") {
if _, ok := r.Prop.InstanceLabels[name]; !ok {
r.Prop.InstanceLabels[name] = r.Prop.Counters[name]
}
// remove from metrics
delete(r.Prop.Metrics, name)
return true
}
d := strings.Clone(c.Get("denominator.name").String())
if d != "" {
if _, has := r.Prop.Metrics[d]; !has {
Expand Down

0 comments on commit dc4e311

Please sign in to comment.