Add metric parsing scripts to generate additions/removals for complex changes.

These scripts hold some learnings on how to compare changes to the metric
profile of the exporter. In future we'll teach travis to build this against
master automatically and post a comment back to a PR with what's been changed.

For now we just want to store them.
This commit is contained in:
Will Rouesnel 2017-04-14 01:57:51 +10:00
parent f6e4292bc5
commit 994be318d4
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,11 @@
#!/bin/bash
# Script to determine added and removed metrics.
# Not currently used in CI but useful for inspecting complicated changes.
type=$1
version=$2
old_version=$3
new_version=$4
comm -23 $old_version $new_version > .metrics.${type}.${version}.removed
comm -13 $old_version $new_version > .metrics.${type}.${version}.added

16
postgres_metrics_parse_script Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
# Script to parse a text exposition format file into a unique list of metrics
# output by the exporter.
# Not currently used for CI, but useful for inspecting the differences of
# complicated PRs.
for raw_prom in $(echo .*.prom) ; do
# Strip, sort and deduplicate the label names
cat $raw_prom | grep -v '#' | \
rev | cut -d' ' -f2- | \
rev | cut -d'{' -f1 | \
sort | \
uniq > ${raw_prom}.unique
done