Skip to content

Commit 1e5f7f4

Browse files
committed
Fix the metric changes script.
1 parent 5854cac commit 1e5f7f4

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@
1515
/*.prom
1616
/.metrics.*.*.prom
1717
/.metrics.*.*.prom.unique
18+
/.assets-branch
19+
/.metrics.*.added
20+
/.metrics.*.removed

postgres-metrics-get-changes.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@ function generate_add_removed() {
1111
old_version="$3"
1212
new_version="$4"
1313

14+
if [ ! -e "$old_version" ] ; then
15+
touch "$old_version"
16+
fi
17+
1418
comm -23 "$old_version" "$new_version" > ".metrics.${type}.${pg_version}.removed"
1519
comm -13 "$old_version" "$new_version" > ".metrics.${type}.${pg_version}.added"
1620
}
1721

1822
for raw_prom in $(echo .*.prom) ; do
1923
# Get the type and version
20-
type=$(cut -d'.' -f3)
21-
pg_version=$(cut -d'.' -f4)
24+
type=$(echo "$raw_prom" | cut -d'.' -f3)
25+
pg_version=$(echo "$raw_prom" | cut -d'.' -f4- | sed 's/\.prom$//g')
2226

2327
unique_file="${raw_prom}.unique"
2428
old_unique_file="$old_src/$unique_file"

0 commit comments

Comments
 (0)