forked from ceph/s3-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
results_to_metrics
executable file
·30 lines (26 loc) · 1.12 KB
/
results_to_metrics
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/awk -f
BEGIN{
new_failures=0
unexpected_pass=0
}
# the unexpected pass tests list is printed after the header 'UNEXPECTED_PASS:'
/^UNEXPECTED_PASS:$/ { type="unexpected_pass"; next }
# the new failures tests list is printed after the header 'NEW_FAILURES:'
/^NEW_FAILURE:$/ { type="new_failures"; next }
# samples:
# s3tests_boto3.functional.test_s3.test_buckets_list_ctime
# <nose.suite.ContextSuite context=s3tests_boto3.functional.test_s3>:setup
/^.+/ {
if (type == "new_failures") {
new_failures++
}
if (type == "unexpected_pass") {
unexpected_pass++
}
}
END {
print "ceph_s3_tests_last_results_duration_seconds{infra_id=\"" ENVIRON["CDS_ENV_infra_id"] "\"} " ENVIRON["CDS_BUILD_TESTS_DURATION"]
print "ceph_s3_tests_last_results_count{type=\"new_failures\",infra_id=\"" ENVIRON["CDS_ENV_infra_id"] "\"} " new_failures
print "ceph_s3_tests_last_results_count{type=\"unexpected_pass\",infra_id=\"" ENVIRON["CDS_ENV_infra_id"] "\"} " unexpected_pass
print "ceph_s3_tests_last_results_timestamp_seconds{infra_id=\"" ENVIRON["CDS_ENV_infra_id"] "\"} " strftime("%s")
}