Fix the metric changes script.

This commit is contained in:
Will Rouesnel 2018-11-11 18:02:41 +11:00
parent 5854cac87f
commit 1e5f7f46f4
No known key found for this signature in database
GPG Key ID: 72DC65802A1091C5
2 changed files with 9 additions and 2 deletions

3
.gitignore vendored
View File

@ -15,3 +15,6 @@
/*.prom /*.prom
/.metrics.*.*.prom /.metrics.*.*.prom
/.metrics.*.*.prom.unique /.metrics.*.*.prom.unique
/.assets-branch
/.metrics.*.added
/.metrics.*.removed

View File

@ -11,14 +11,18 @@ function generate_add_removed() {
old_version="$3" old_version="$3"
new_version="$4" new_version="$4"
if [ ! -e "$old_version" ] ; then
touch "$old_version"
fi
comm -23 "$old_version" "$new_version" > ".metrics.${type}.${pg_version}.removed" comm -23 "$old_version" "$new_version" > ".metrics.${type}.${pg_version}.removed"
comm -13 "$old_version" "$new_version" > ".metrics.${type}.${pg_version}.added" comm -13 "$old_version" "$new_version" > ".metrics.${type}.${pg_version}.added"
} }
for raw_prom in $(echo .*.prom) ; do for raw_prom in $(echo .*.prom) ; do
# Get the type and version # Get the type and version
type=$(cut -d'.' -f3) type=$(echo "$raw_prom" | cut -d'.' -f3)
pg_version=$(cut -d'.' -f4) pg_version=$(echo "$raw_prom" | cut -d'.' -f4- | sed 's/\.prom$//g')
unique_file="${raw_prom}.unique" unique_file="${raw_prom}.unique"
old_unique_file="$old_src/$unique_file" old_unique_file="$old_src/$unique_file"