sbm

simple bandwidth monitor
git clone git://git.2f30.org/sbm.git
Log | Files | Refs | LICENSE

commit dd3836fca060a82872ad7ed79f49b2195a9b9fa7
parent a8586c2025275a819f556cf3895b4f880f4ccbaf
Author: sin <sin@2f30.org>
Date:   Tue Feb 23 15:59:05 +0000

Rename sbm-plot-real to sbm-rt-plot

Diffstat:
Makefile | 6+++---
sbm-plot-real | 35-----------------------------------
sbm-rt-plot | 35+++++++++++++++++++++++++++++++++++
3 files changed, 38 insertions(+), 38 deletions(-)
diff --git a/Makefile b/Makefile @@ -19,19 +19,19 @@ install: all mkdir -p $(DESTDIR)$(PREFIX)/bin cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin cp -f sbm-plot $(DESTDIR)$(PREFIX)/bin - cp -f sbm-plot-real $(DESTDIR)$(PREFIX)/bin + cp -f sbm-rt-plot $(DESTDIR)$(PREFIX)/bin mkdir -p $(DESTDIR)$(MANPREFIX)/man1 cp -f $(BIN).1 $(DESTDIR)$(MANPREFIX)/man1 uninstall: rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN) rm -f $(DESTDIR)$(PREFIX)/bin/sbm-plot - rm -f $(DESTDIR)$(PREFIX)/bin/sbm-plot-real + rm -f $(DESTDIR)$(PREFIX)/bin/sbm-rt-plot rm -f $(DESTDIR)$(MANPREFIX)/man1/$(BIN).1 dist: clean mkdir -p sbm-$(VERSION) - cp LICENSE Makefile arg.h sbm-plot sbm-plot-real sbm.1 sbm.c sbm-$(VERSION) + cp LICENSE Makefile arg.h sbm-plot sbm-rt-plot sbm.1 sbm.c sbm-$(VERSION) tar -cf sbm-$(VERSION).tar sbm-$(VERSION) gzip sbm-$(VERSION).tar rm -rf sbm-$(VERSION) diff --git a/sbm-plot-real b/sbm-plot-real @@ -1,35 +0,0 @@ -#!/bin/sh -# See LICENSE file for copyright and license details. - -command -v gnuplot >/dev/null || { - echo gnuplot is not installed 1>&2 - exit 1 -} - -datafile=`mktemp` -plotfile=`mktemp` -trap "rm -f $datafile $plotfile" EXIT -sbm -c 1 -t > "$datafile" -( -cat << 'EOF' -set multiplot layout 1, 2 -set autoscale -set grid -set xlabel "time" -set ylabel "Mbps" -datafile=system("echo $DATAFILE") -plot datafile using ($1/1000/1000) with lines title "RX Mbps", \ - datafile using ($2/1000/1000) with lines title "TX Mbps" -set xlabel "time" -set ylabel "pps" -plot datafile using ($3) with lines title "RX pps", \ - datafile using ($4) with lines title "TX pps" -pause 1 -reread -EOF -) > "$plotfile" -DATAFILE="$datafile" gnuplot "$plotfile" & - -while :; do - sbm -c 1 -t >> "$datafile" -done diff --git a/sbm-rt-plot b/sbm-rt-plot @@ -0,0 +1,35 @@ +#!/bin/sh +# See LICENSE file for copyright and license details. + +command -v gnuplot >/dev/null || { + echo gnuplot is not installed 1>&2 + exit 1 +} + +datafile=`mktemp` +plotfile=`mktemp` +trap "rm -f $datafile $plotfile" EXIT +sbm -c 1 -t > "$datafile" +( +cat << 'EOF' +set multiplot layout 1, 2 +set autoscale +set grid +set xlabel "time" +set ylabel "Mbps" +datafile=system("echo $DATAFILE") +plot datafile using ($1/1000/1000) with lines title "RX Mbps", \ + datafile using ($2/1000/1000) with lines title "TX Mbps" +set xlabel "time" +set ylabel "pps" +plot datafile using ($3) with lines title "RX pps", \ + datafile using ($4) with lines title "TX pps" +pause 1 +reread +EOF +) > "$plotfile" +DATAFILE="$datafile" gnuplot "$plotfile" & + +while :; do + sbm -c 1 -t >> "$datafile" +done