|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T l
Length: 3275 (0xccb)
Types: TextFile
Names: »line.awk«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
└─⟦dc59850a2⟧ »EurOpenD22/pp5.0/pp-5.tar.Z«
└─⟦e5a54fb17⟧
└─⟦this⟧ »pp-5.0/Tools/statgen/line.awk«
#! /bin/sh
awk '
BEGIN {
FS = "|"
minday = minmonth = 999
}
$3 == "DR_good" {
good_drs ++
next
}
$3 == "totalDR" {
drs_generated ++
}
$3 == "DR" {
if (NF != 12) {
print "Bad record line NR", $0 | "cat 1>&2"
next
}
drs_generated ++
}
$3 == "dr_ok" {
if (NF != 8) {
print "Bad record line NR", $0 | "cat 1>&2"
next
}
drs_passed ++
}
$3 == "dr_failed" {
if (NF != 8) {
print "Bad record line NR", $0 | "cat 1>&2"
next
}
drs_failed ++
}
$3 == "ok" || $3 == "ok-testfailed" || $3 == "failed" {
if (NF != 12) {
print "Bad record line NR", $0 | "cat 1>&2"
next
}
if (NR == 1) {
first_month = $1; first_day = $2
}
last_month = $1; last_day = $2
if ($3 != "ok") {
failed ++
failure_addr[$3] ++
if (fm[$4] == 0) {
failure_msgs[$3] ++
fm[$4] = 1
}
}
total_addr ++
if (im[$4] == 0) {
total_msgs ++
total_size += $7
im[$4] = 1
inchan_size[$5] += $7
if (ih[$5] == 0) {
total_inmta ++
inchan_nhosts[$5] ++
ih[$5] = 1
}
inchan_nmsgs[$5] ++
}
inchan_naddr[$5] ++
if (om[$4 $6] == 0) {
om[$4 $6] = 1
outchan_size[$6] += $7
if (oh[$6] == 0) {
total_outmta ++
outchan_nhosts[$6] ++
oh[$6] = 1
}
outchan_nmsgs[$6] ++
}
outchan_naddr[$6] ++;
cp = $5 " -> " $6
chpair_naddr[cp] ++
if (cm[$4 cp] == 0) {
cm[$4 cp] = 1
chpair_size[cp] += $7
chpair_nmsgs[cp] ++
}
}
END {
printf "SUMMARY for period %d/%d to %d/%d\n", \
first_month, first_day, last_month, last_day
printf "%-20s: %d\n", "Messages", total_msgs
printf "%-20s: %d\n", "Addresses", total_addr
printf "%-20s: %d\n", "Bytes", total_size
printf "%-20s: %d\n", "Inbound MTAs", total_inmta
printf "%-20s: %d\n", "Outbound MTAs", total_outmta
if (good_drs)
printf "%-20s: %d\n", "Positive DR's", good_drs
if (drs_passed)
printf "%-20s: %d\n", "DRs relayed", drs_passed
if (drs_failed)
printf "%-20s: %d\n", "DRs relayed", drs_failed
if (drs_generated)
printf "%-20s: %d\n", "DRs generated", drs_generated
if (failed) {
for (i in failure_addr)
printf "%-20s: %d Addrs %d Msgs\n", "Failure - " i, \
failure_addr[i], failure_msgs[i]
}
print "\n"
print "Inbound Channel Totals"
title = "Channel"
maxw = length(title)
for (i in inchan_naddr)
if (length(i) > maxw)
maxw = length(i)
format = "%-" maxw "s %8d %8d %12d\n"
printf "%-" maxw "s %8s %8s %12s\n", title, \
"Msgs", "Addr", "Bytes", "MTAs"
for (i in inchan_naddr)
printf format, i, \
inchan_nmsgs[i], inchan_naddr[i], \
inchan_size[i], inchan_nhosts[i]
print ""; print "";
print "Outbound Channel Totals"
title = "Channel"
maxw = length(title)
for (i in outchan_naddr)
if (length(i) > maxw)
maxw = length(i)
printf "%-" maxw "s %8s %8s %12s\n", title,\
"Msgs", "Addr", "Bytes", "MTAs"
for (i in outchan_naddr)
printf "%-" maxw "s %8d %8d %12d\n", i, \
outchan_nmsgs[i], outchan_naddr[i], \
outchan_size[i], outchan_nhosts[i]
print ""; print ""
print "Channel Pair Totals"
title = "Channel"
maxw = length(title)
for (i in chpair_naddr)
if (length(i) > maxw)
maxw = length(i)
printf "%-" maxw "s %8s %8s %12s\n", title, \
"Msgs", "Addrs", "Bytes"
for (i in chpair_naddr)
printf "%-" maxw "s %8d %8d %12d\n", i, \
chpair_nmsgs[i], chpair_naddr[i], chpair_size[i]
}' $*