Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
fix end2end metric name
Browse files Browse the repository at this point in the history
  • Loading branch information
Dieterbe committed Dec 28, 2016
1 parent 1e7fe3e commit 0378625
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/verify_metrics_received.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def error(msg):
},
'data': {
'target':
'stats.docker-env.metrictank.default.carbon.metrics_received',
'perSecond(metrictank.stats.docker-env.default.input.carbon.metrics_received.counter32)',
},
}

Expand All @@ -53,21 +53,22 @@ def error(msg):
)

# verify the format and content of the response is as we expect it
# note : since we got a perSecond(), the first value is always null, we only use points 2 and onwards
if (
len(parsed_result) < 1 or
'datapoints' not in parsed_result[0] or
not all([len(x) >= 2 for x in parsed_result[0]['datapoints']]) or
not all([
isinstance(x[0], (int, float))
for x in parsed_result[0]['datapoints']
for x in parsed_result[0]['datapoints'][1:]
])
):
error(
'received unexpected response:\n{response}'
.format(response=result.text)
)

datapoints = [float(x[0]) for x in parsed_result[0]['datapoints']]
datapoints = [float(x[0]) for x in parsed_result[0]['datapoints'][1:]]
datapoints_avg = sum(datapoints)/len(datapoints)
expected = float(sys.argv[4])

Expand Down

0 comments on commit 0378625

Please sign in to comment.