diff options
author | Leon Rische <leon.rische@me.com> | 2020-04-29 23:01:11 +0200 |
---|---|---|
committer | Leon Rische <leon.rische@me.com> | 2020-05-01 14:13:20 +0200 |
commit | c53af60c891fa06b285e2cbba40b60fcb3419aaf (patch) | |
tree | 74c0e43ecf280ed0508b5866e352f87cda5d08a7 /awk | |
parent | f7114a4c40d79d6a0750416b0444c2147136e110 (diff) |
Generate S-expressions in stats awk scripts
Diffstat (limited to 'awk')
-rw-r--r-- | awk/stats_cards.awk | 14 | ||||
-rw-r--r-- | awk/stats_positions.awk | 22 |
2 files changed, 20 insertions, 16 deletions
diff --git a/awk/stats_cards.awk b/awk/stats_cards.awk index 44cd9b3..31a0047 100644 --- a/awk/stats_cards.awk +++ b/awk/stats_cards.awk @@ -37,12 +37,14 @@ BEGIN { } END { - print "total" "\t" total; - print "suspended" "\t" n_suspended; - print "created-day" "\t" created["day"]; - print "created-week" "\t" created["week"]; - print "created-month" "\t" created["month"]; + print "(" + print " :total " total; + print " :suspended " n_suspended; + print " :created-day " created["day"]; + print " :created-week " created["week"]; + print " :created-month " created["month"]; for (var in by_type) { - print "type-" var "\t" by_type[var]; + print " :type-" var " " by_type[var]; } + print ")" } diff --git a/awk/stats_positions.awk b/awk/stats_positions.awk index 735013a..c276f87 100644 --- a/awk/stats_positions.awk +++ b/awk/stats_positions.awk @@ -33,20 +33,22 @@ BEGIN { } END { - print "total" "\t" total; - print "suspended" "\t" suspended; - print "due" "\t" due; + print "(" + print " :total " total; + print " :suspended " suspended; + print " :due " due; for (var in by_type) { - print "type-" var "\t" by_type[var]; + print " :type-" var " " by_type[var]; } if (n_stats > 0) { - print "avg-ease" "\t" ease / n_stats; - print "avg-box" "\t" box / n_stats; - print "avg-interval" "\t" interval / n_stats; + print " :avg-ease " ease / n_stats; + print " :avg-box " box / n_stats; + print " :avg-interval " interval / n_stats; } else { - print "avg-ease" "\t" 0.0; - print "avg-box" "\t" 0; - print "avg-interval" "\t" 0.0; + print " :avg-ease " 0.0; + print " :avg-box " 0; + print " :avg-interval " 0.0; } + print ")" } |