summaryrefslogtreecommitdiff
path: root/src/ddist.sh
diff options
context:
space:
mode:
authorJannis Hoffmann <jannis@fehcom.de>2024-07-09 11:44:11 +0200
committerJannis Hoffmann <jannis@fehcom.de>2024-07-09 11:44:11 +0200
commitf1b71c9fe7dbb4886588a036399cf5ebe16b7c47 (patch)
treee07786aa479c9fb6ee3e537078470aaab5454f80 /src/ddist.sh
parenta293489ee83c8b05d845a162dc2a4de026f3775d (diff)
removed top level directory
Diffstat (limited to 'src/ddist.sh')
-rw-r--r--src/ddist.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/ddist.sh b/src/ddist.sh
new file mode 100644
index 0000000..b632572
--- /dev/null
+++ b/src/ddist.sh
@@ -0,0 +1,31 @@
+
+awk '/^d k/ { print $5 - $3 }' \
+| sort -n \
+| awk '
+ { x += 1; cumulative[$1] = x }
+ END {
+ if (x > 0) {
+ for (p = 0;p <= 100;++p) mindel[p] = -1
+ for (d in cumulative) {
+ p = int((cumulative[d] * 100) / x)
+ if (mindel[p] == -1) mindel[p] = d
+ else if (d < mindel[p]) mindel[p] = d
+ totdel[p] += d
+ numdel[p] += 1
+ }
+ td = 0
+ nd = 0
+ for (p = 0;p <= 100;++p) {
+ td += totdel[p]
+ nd += numdel[p]
+ if (p >= 10)
+ if (nd > 0)
+ if (mindel[p] >= 0) {
+ str1 = sprintf("%.2f",mindel[p])
+ str2 = sprintf("%.2f",td / nd)
+ print str1, str2, p
+ }
+ }
+ }
+ }
+'