Skip to content

Commit

Permalink
include plan name in result metric (#36)
Browse files Browse the repository at this point in the history
* include plan name in result metric

* remove commented lines
  • Loading branch information
nonsense authored Jan 26, 2021
1 parent 1e40e1b commit 0c2df83
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions runtime/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ func newMetrics(re *RunEnv) *Metrics {
var dsinks = []MetricSinkFn{m.logSinkJSON("diagnostics.out")}
if client, err := NewInfluxDBClient(re); err == nil {
m.tags = map[string]string{
"plan": re.TestPlan,
"case": re.TestCase,
"run": re.TestRun,
"group_id": re.TestGroupID,
}
Expand Down Expand Up @@ -168,7 +166,8 @@ func (m *Metrics) writeToInfluxDBSink(measurementType string) MetricSinkFn {
tags = m.tags
}

measurementName := fmt.Sprintf("%s.%s.%s", measurementType, vals[0], metric.Type.String())
prefix := fmt.Sprintf("%s.%s-%s", measurementType, m.re.TestPlan, m.re.TestCase)
measurementName := fmt.Sprintf("%s.%s.%s", prefix, vals[0], metric.Type.String())

p, err := client.NewPoint(measurementName, tags, fields, time.Unix(0, metric.Timestamp))
if err != nil {
Expand Down

0 comments on commit 0c2df83

Please sign in to comment.