Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ Standards-Version: 4.1.2

Package: performance-diagnostics
Architecture: any
Depends: python3-bpfcc, python3-minimal, python3-psutil, telegraf, docker-ce, influxdb2, curl, openssl, jq
Depends: python3-bpfcc, python3-minimal, python3-psutil, telegraf, docker-ce, influxdb2, curl, openssl, jq, mawk
Description: eBPF-based Performance Diagnostic Tools
A collection of eBPF-based tools for diagnosing performance issues.
13 changes: 6 additions & 7 deletions telegraf/connstat-stats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
# swnd, cwnd, rwnd, rtt (averaged across connections)
# connections (count of aggregated conns)
#
# mawk (the default awk on Delphix engines) does not flush its stdout buffer
# when writing to a Telegraf execd pipe, even with explicit fflush() calls.
# stdbuf -oL forces line-buffered stdout on awk, so each output line is
# delivered to Telegraf immediately without needing awk to exit.
# mawk (the default awk on Delphix engines) reads a pipe in blocks: it keeps
# reading until its 256 KB input buffer is full, or EOF, before processing any
# record. connstat never exits and writes a few KB per interval, so plain mawk
# prints nothing; stdbuf -oL and fflush() affect only output and don't help.
# -W interactive makes mawk read stdin line by line (and unbuffers stdout).
/usr/bin/connstat -PLe -i 10 -T u \
-o laddr,lport,raddr,rport,inbytes,outbytes,retranssegs,suna,unsent,swnd,cwnd,rwnd,rtt \
| stdbuf -oL awk -F',' '
| /usr/bin/mawk -W interactive -F',' '
BEGIN {
batch_ts = 0
# Load port->service mapping from /etc/services, same as LocalTCPStatsCollector.
Expand Down Expand Up @@ -53,7 +54,6 @@ BEGIN {
inb[key] "," outb[key] "," ret[key] "," sun[key] "," uns[key] "," \
int(sw[key]/n) "," int(cw[key]/n) "," int(rw[key]/n) "," int(rt[key]/n) "," n "," batch_ts
}
fflush()
ts = $0; sub(/^=[[:space:]]*/, "", ts); batch_ts = ts + 0
delete cnt; delete inb; delete outb; delete ret
delete sun; delete uns; delete sw; delete cw; delete rw; delete rt
Expand Down Expand Up @@ -81,6 +81,5 @@ END {
inb[key] "," outb[key] "," ret[key] "," sun[key] "," uns[key] "," \
int(sw[key]/n) "," int(cw[key]/n) "," int(rw[key]/n) "," int(rt[key]/n) "," n "," batch_ts
}
fflush()
}
'
Loading