monero-exporter/hack/table-printer.awk
Ciro S. Costa 5febff4a8d collect height and target-height from info
this way we can figure out how far we are from the main chain's height
during sync

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-08-03 17:05:09 -04:00

24 lines
501 B
Awk
Executable File

#!/usr/bin/awk -f
# gh-table-printer - prints to `stdout` the metric descriptions
# in GitHub flavored markdown tables[1].
#
# [1] - https://help.github.com/articles/organizing-information-with-tables/
#
# Usage: `curl -s localhost:9000/metrics | grep monero_ | ./gh-table-printer`
BEGIN {
print "| name | description |"
print "| ---- | ----------- |"
}
/HELP/ {
line="| " $3 " |"
for (i = 4; i <= NF; i++) {
line = line " "$i
}
line = line " |"
print line
}