%description: Test scavetool's query command %file: test.ned simple Node extends testlib.StatNode { @statistic[foo](source=foo; record=mean,last,stats,histogram,vector); } network Test { submodules: node: Node; } %inifile: omnetpp.ini [General] network = Test repeat = 2 %prerun-command: rm -f results/* %postrun-command: bash ./testscript.sh %file: testscript.sh # # Replace datetime and processId with "xxxx" in the result files, as they are different all the time # for f in results/*; do perl -i -pe 's/(run General-.)-.*/\1-xxxx/' $f perl -i -pe 's/(attr datetime ).*/\1 xxxx/' $f perl -i -pe 's/(attr processid ).*/\1 xxxx/' $f done # # scavetool wrapper, for output, error handling and shorter command lines # run() { echo "------------------------" echo "$ scavetool $* " scavetool "$@" results/*.sca results/*.vec 2>&1 || echo ERROR } # # Plain invocations # run run q run query # # Mode switch # -s, --print-summary Report the number of result items. (This is the default.) # -l, --list-results List result items # -a, --list-runattrs List run attributes # -n, --list-names List unique result (vector, scalar, etc) names # -m, --list-modules List unique module names # -e --list-qnames List unique result names qualified with the module names they occur with # -r, --list-runs List unique runs # -c, --list-configs List unique configuration names # run -s run -l run -a run -n run -m run -e run -r run -c run --print-summary run --list-results run --list-runattrs run --list-names run --list-modules run --list-qnames run --list-runs run --list-configs # # -T, --type Limit item types; is concatenation of type characters (v=vector, s=scalar, h=histogram). # run --type sv run -Ts run -Tv run -Th run -Tsv run -T sv # # -f, --filter Filter for result items (vectors, scalars, statistics, histograms) matched by filter expression # run -l --filter "*:mean" run -l -f "*:mean" run -l -f "name(*:mean)" run -l -f '*:mean OR *:vector' run -l -f 'module(Test.node) AND *:vector' # try with -e (--list-qnames) as well run -e -f '*:mean OR *:vector' # # -p, --per-run Per-run reporting (where applicable) # run -s --per-run run -s -p run -l -p run -a -p run -n -p run -m -p run -e -p run -r -p run -c -p # # -b, --bare Suppress labels (more suitable for machine processing) # run -l --bare run -l -b # # -g, --grep-friendly Grep-friendly: with -p, put run names at the start of each line, not above groups as headings. # # run -l --grep-friendly run -l -g run -n --per-run -g run -m --per-run -g run -e --per-run -g # # --tabs Use tabs in tables instead of padding with spaces. # run -l --tabs run -l --grep-friendly --tabs # # -w, --add-fields-as-scalars Add statistics fields (count, sum, mean, stddev, min, max, etc) as scalars # run -l --add-fields-as-scalars run -l -w # # -D, --rundisplay Display format for run; can be any of: # 'runid' Displays ${runid} (this is the default) # 'runnumber' Displays ${configname} ${runnumber} # 'itervars' Displays ${configname} ${iterationvars} ${repetition} # 'experiment' Displays ${experiment} ${measurement} ${replication} # run -r --rundisplay runnumber run -r -D runid run -r -D runnumber run -r -D itervars run -r -D experiment # # -k, --no-indexing Disallow automatic indexing of vector files # # just test that it's accepted run -k run --no-indexing # # -v, --verbose Print info about progress (verbose) # run -v run --verbose echo . %contains: postrun-command(1).out ------------------------ $ scavetool runs: 2 scalars: 4 vectors: 2 statistics: 2 histograms: 2 ------------------------ $ scavetool q runs: 2 scalars: 4 vectors: 2 statistics: 2 histograms: 2 ------------------------ $ scavetool query runs: 2 scalars: 4 vectors: 2 statistics: 2 histograms: 2 ------------------------ $ scavetool -s runs: 2 scalars: 4 vectors: 2 statistics: 2 histograms: 2 ------------------------ $ scavetool -l General-0-xxxx: scalar Test.node foo:mean 19.84 scalar Test.node foo:last 17 vector Test.node foo:vector vectorId=0 count=100 mean=19.84 min=12 max=28 statistics Test.node foo:stats count=100 mean=19.84 min=12 max=28 histogram Test.node foo:histogram count=100 mean=19.84 min=12 max=28 #bins=26 General-1-xxxx: scalar Test.node foo:mean 19.65 scalar Test.node foo:last 19 vector Test.node foo:vector vectorId=0 count=100 mean=19.65 min=13 max=27 statistics Test.node foo:stats count=100 mean=19.65 min=13 max=27 histogram Test.node foo:histogram count=100 mean=19.65 min=13 max=27 #bins=24 ------------------------ $ scavetool -a General-0-xxxx: configname General datetime xxxx experiment General inifile _defaults.ini iterationvars iterationvarsf measurement network Test processid xxxx repetition 0 replication #0 resultdir results runnumber 0 seedset 0 General-1-xxxx: configname General datetime xxxx experiment General inifile _defaults.ini iterationvars iterationvarsf measurement network Test processid xxxx repetition 1 replication #1 resultdir results runnumber 1 seedset 1 ------------------------ $ scavetool -n foo:histogram foo:last foo:mean foo:stats foo:vector ------------------------ $ scavetool -m Test.node ------------------------ $ scavetool -e Test.node.foo:histogram Test.node.foo:last Test.node.foo:mean Test.node.foo:stats Test.node.foo:vector ------------------------ $ scavetool -r General-0-xxxx General-1-xxxx ------------------------ $ scavetool -c General ------------------------ $ scavetool --print-summary runs: 2 scalars: 4 vectors: 2 statistics: 2 histograms: 2 ------------------------ $ scavetool --list-results General-0-xxxx: scalar Test.node foo:mean 19.84 scalar Test.node foo:last 17 vector Test.node foo:vector vectorId=0 count=100 mean=19.84 min=12 max=28 statistics Test.node foo:stats count=100 mean=19.84 min=12 max=28 histogram Test.node foo:histogram count=100 mean=19.84 min=12 max=28 #bins=26 General-1-xxxx: scalar Test.node foo:mean 19.65 scalar Test.node foo:last 19 vector Test.node foo:vector vectorId=0 count=100 mean=19.65 min=13 max=27 statistics Test.node foo:stats count=100 mean=19.65 min=13 max=27 histogram Test.node foo:histogram count=100 mean=19.65 min=13 max=27 #bins=24 ------------------------ $ scavetool --list-runattrs General-0-xxxx: configname General datetime xxxx experiment General inifile _defaults.ini iterationvars iterationvarsf measurement network Test processid xxxx repetition 0 replication #0 resultdir results runnumber 0 seedset 0 General-1-xxxx: configname General datetime xxxx experiment General inifile _defaults.ini iterationvars iterationvarsf measurement network Test processid xxxx repetition 1 replication #1 resultdir results runnumber 1 seedset 1 ------------------------ $ scavetool --list-names foo:histogram foo:last foo:mean foo:stats foo:vector ------------------------ $ scavetool --list-modules Test.node ------------------------ $ scavetool --list-qnames Test.node.foo:histogram Test.node.foo:last Test.node.foo:mean Test.node.foo:stats Test.node.foo:vector ------------------------ $ scavetool --list-runs General-0-xxxx General-1-xxxx ------------------------ $ scavetool --list-configs General ------------------------ $ scavetool --type sv runs: 2 scalars: 4 vectors: 2 ------------------------ $ scavetool -Ts runs: 2 scalars: 4 ------------------------ $ scavetool -Tv runs: 2 vectors: 2 ------------------------ $ scavetool -Th runs: 2 histograms: 2 ------------------------ $ scavetool -Tsv runs: 2 scalars: 4 vectors: 2 ------------------------ $ scavetool -T sv runs: 2 scalars: 4 vectors: 2 ------------------------ $ scavetool -l --filter *:mean General-0-xxxx: scalar Test.node foo:mean 19.84 General-1-xxxx: scalar Test.node foo:mean 19.65 ------------------------ $ scavetool -l -f *:mean General-0-xxxx: scalar Test.node foo:mean 19.84 General-1-xxxx: scalar Test.node foo:mean 19.65 ------------------------ $ scavetool -l -f name(*:mean) General-0-xxxx: scalar Test.node foo:mean 19.84 General-1-xxxx: scalar Test.node foo:mean 19.65 ------------------------ $ scavetool -l -f *:mean OR *:vector General-0-xxxx: scalar Test.node foo:mean 19.84 vector Test.node foo:vector vectorId=0 count=100 mean=19.84 min=12 max=28 General-1-xxxx: scalar Test.node foo:mean 19.65 vector Test.node foo:vector vectorId=0 count=100 mean=19.65 min=13 max=27 ------------------------ $ scavetool -l -f module(Test.node) AND *:vector General-0-xxxx: vector Test.node foo:vector vectorId=0 count=100 mean=19.84 min=12 max=28 General-1-xxxx: vector Test.node foo:vector vectorId=0 count=100 mean=19.65 min=13 max=27 ------------------------ $ scavetool -e -f *:mean OR *:vector Test.node.foo:mean Test.node.foo:vector ------------------------ $ scavetool -s --per-run General-0-xxxx scalars: 2 vectors: 1 statistics: 1 histograms: 1 General-1-xxxx scalars: 2 vectors: 1 statistics: 1 histograms: 1 ------------------------ $ scavetool -s -p General-0-xxxx scalars: 2 vectors: 1 statistics: 1 histograms: 1 General-1-xxxx scalars: 2 vectors: 1 statistics: 1 histograms: 1 ------------------------ $ scavetool -l -p General-0-xxxx: scalar Test.node foo:mean 19.84 scalar Test.node foo:last 17 vector Test.node foo:vector vectorId=0 count=100 mean=19.84 min=12 max=28 statistics Test.node foo:stats count=100 mean=19.84 min=12 max=28 histogram Test.node foo:histogram count=100 mean=19.84 min=12 max=28 #bins=26 General-1-xxxx: scalar Test.node foo:mean 19.65 scalar Test.node foo:last 19 vector Test.node foo:vector vectorId=0 count=100 mean=19.65 min=13 max=27 statistics Test.node foo:stats count=100 mean=19.65 min=13 max=27 histogram Test.node foo:histogram count=100 mean=19.65 min=13 max=27 #bins=24 ------------------------ $ scavetool -a -p General-0-xxxx: configname General datetime xxxx experiment General inifile _defaults.ini iterationvars iterationvarsf measurement network Test processid xxxx repetition 0 replication #0 resultdir results runnumber 0 seedset 0 General-1-xxxx: configname General datetime xxxx experiment General inifile _defaults.ini iterationvars iterationvarsf measurement network Test processid xxxx repetition 1 replication #1 resultdir results runnumber 1 seedset 1 ------------------------ $ scavetool -n -p General-0-xxxx: foo:histogram foo:last foo:mean foo:stats foo:vector General-1-xxxx: foo:histogram foo:last foo:mean foo:stats foo:vector ------------------------ $ scavetool -m -p General-0-xxxx: Test.node General-1-xxxx: Test.node ------------------------ $ scavetool -e -p General-0-xxxx: Test.node.foo:histogram Test.node.foo:last Test.node.foo:mean Test.node.foo:stats Test.node.foo:vector General-1-xxxx: Test.node.foo:histogram Test.node.foo:last Test.node.foo:mean Test.node.foo:stats Test.node.foo:vector ------------------------ $ scavetool -r -p General-0-xxxx General-1-xxxx ------------------------ $ scavetool -c -p General ------------------------ $ scavetool -l --bare General-0-xxxx: scalar Test.node foo:mean 19.84 scalar Test.node foo:last 17 vector Test.node foo:vector 0 100 19.84 12 28 statistics Test.node foo:stats 100 19.84 12 28 histogram Test.node foo:histogram 100 19.84 12 28 26 General-1-xxxx: scalar Test.node foo:mean 19.65 scalar Test.node foo:last 19 vector Test.node foo:vector 0 100 19.65 13 27 statistics Test.node foo:stats 100 19.65 13 27 histogram Test.node foo:histogram 100 19.65 13 27 24 ------------------------ $ scavetool -l -b General-0-xxxx: scalar Test.node foo:mean 19.84 scalar Test.node foo:last 17 vector Test.node foo:vector 0 100 19.84 12 28 statistics Test.node foo:stats 100 19.84 12 28 histogram Test.node foo:histogram 100 19.84 12 28 26 General-1-xxxx: scalar Test.node foo:mean 19.65 scalar Test.node foo:last 19 vector Test.node foo:vector 0 100 19.65 13 27 statistics Test.node foo:stats 100 19.65 13 27 histogram Test.node foo:histogram 100 19.65 13 27 24 ------------------------ $ scavetool -l --grep-friendly General-0-xxxx scalar Test.node foo:mean 19.84 General-0-xxxx scalar Test.node foo:last 17 General-0-xxxx vector Test.node foo:vector vectorId=0 count=100 mean=19.84 min=12 max=28 General-0-xxxx statistics Test.node foo:stats count=100 mean=19.84 min=12 max=28 General-0-xxxx histogram Test.node foo:histogram count=100 mean=19.84 min=12 max=28 #bins=26 General-1-xxxx scalar Test.node foo:mean 19.65 General-1-xxxx scalar Test.node foo:last 19 General-1-xxxx vector Test.node foo:vector vectorId=0 count=100 mean=19.65 min=13 max=27 General-1-xxxx statistics Test.node foo:stats count=100 mean=19.65 min=13 max=27 General-1-xxxx histogram Test.node foo:histogram count=100 mean=19.65 min=13 max=27 #bins=24 ------------------------ $ scavetool -l -g General-0-xxxx scalar Test.node foo:mean 19.84 General-0-xxxx scalar Test.node foo:last 17 General-0-xxxx vector Test.node foo:vector vectorId=0 count=100 mean=19.84 min=12 max=28 General-0-xxxx statistics Test.node foo:stats count=100 mean=19.84 min=12 max=28 General-0-xxxx histogram Test.node foo:histogram count=100 mean=19.84 min=12 max=28 #bins=26 General-1-xxxx scalar Test.node foo:mean 19.65 General-1-xxxx scalar Test.node foo:last 19 General-1-xxxx vector Test.node foo:vector vectorId=0 count=100 mean=19.65 min=13 max=27 General-1-xxxx statistics Test.node foo:stats count=100 mean=19.65 min=13 max=27 General-1-xxxx histogram Test.node foo:histogram count=100 mean=19.65 min=13 max=27 #bins=24 ------------------------ $ scavetool -n --per-run -g General-0-xxxx foo:histogram General-0-xxxx foo:last General-0-xxxx foo:mean General-0-xxxx foo:stats General-0-xxxx foo:vector General-1-xxxx foo:histogram General-1-xxxx foo:last General-1-xxxx foo:mean General-1-xxxx foo:stats General-1-xxxx foo:vector ------------------------ $ scavetool -m --per-run -g General-0-xxxx Test.node General-1-xxxx Test.node ------------------------ $ scavetool -e --per-run -g General-0-xxxx Test.node.foo:histogram General-0-xxxx Test.node.foo:last General-0-xxxx Test.node.foo:mean General-0-xxxx Test.node.foo:stats General-0-xxxx Test.node.foo:vector General-1-xxxx Test.node.foo:histogram General-1-xxxx Test.node.foo:last General-1-xxxx Test.node.foo:mean General-1-xxxx Test.node.foo:stats General-1-xxxx Test.node.foo:vector ------------------------ $ scavetool -l --tabs General-0-xxxx: scalar Test.node foo:mean 19.84 scalar Test.node foo:last 17 vector Test.node foo:vector vectorId=0 count=100 mean=19.84 min=12 max=28 statistics Test.node foo:stats count=100 mean=19.84 min=12 max=28 histogram Test.node foo:histogram count=100 mean=19.84 min=12 max=28 #bins=26 General-1-xxxx: scalar Test.node foo:mean 19.65 scalar Test.node foo:last 19 vector Test.node foo:vector vectorId=0 count=100 mean=19.65 min=13 max=27 statistics Test.node foo:stats count=100 mean=19.65 min=13 max=27 histogram Test.node foo:histogram count=100 mean=19.65 min=13 max=27 #bins=24 ------------------------ $ scavetool -l --grep-friendly --tabs General-0-xxxx scalar Test.node foo:mean 19.84 General-0-xxxx scalar Test.node foo:last 17 General-0-xxxx vector Test.node foo:vector vectorId=0 count=100 mean=19.84 min=12 max=28 General-0-xxxx statistics Test.node foo:stats count=100 mean=19.84 min=12 max=28 General-0-xxxx histogram Test.node foo:histogram count=100 mean=19.84 min=12 max=28 #bins=26 General-1-xxxx scalar Test.node foo:mean 19.65 General-1-xxxx scalar Test.node foo:last 19 General-1-xxxx vector Test.node foo:vector vectorId=0 count=100 mean=19.65 min=13 max=27 General-1-xxxx statistics Test.node foo:stats count=100 mean=19.65 min=13 max=27 General-1-xxxx histogram Test.node foo:histogram count=100 mean=19.65 min=13 max=27 #bins=24 ------------------------ $ scavetool -l --add-fields-as-scalars General-0-xxxx: scalar Test.node foo:mean 19.84 scalar Test.node foo:last 17 scalar Test.node foo:stats:count 100 scalar Test.node foo:stats:mean 19.84 scalar Test.node foo:stats:stddev 3.15499 scalar Test.node foo:stats:min 12 scalar Test.node foo:stats:max 28 scalar Test.node foo:stats:sum 1984 scalar Test.node foo:histogram:count 100 scalar Test.node foo:histogram:mean 19.84 scalar Test.node foo:histogram:stddev 3.15499 scalar Test.node foo:histogram:min 12 scalar Test.node foo:histogram:max 28 scalar Test.node foo:histogram:sum 1984 vector Test.node foo:vector vectorId=0 count=100 mean=19.84 min=12 max=28 statistics Test.node foo:stats count=100 mean=19.84 min=12 max=28 histogram Test.node foo:histogram count=100 mean=19.84 min=12 max=28 #bins=26 General-1-xxxx: scalar Test.node foo:mean 19.65 scalar Test.node foo:last 19 scalar Test.node foo:stats:count 100 scalar Test.node foo:stats:mean 19.65 scalar Test.node foo:stats:stddev 3.33447 scalar Test.node foo:stats:min 13 scalar Test.node foo:stats:max 27 scalar Test.node foo:stats:sum 1965 scalar Test.node foo:histogram:count 100 scalar Test.node foo:histogram:mean 19.65 scalar Test.node foo:histogram:stddev 3.33447 scalar Test.node foo:histogram:min 13 scalar Test.node foo:histogram:max 27 scalar Test.node foo:histogram:sum 1965 vector Test.node foo:vector vectorId=0 count=100 mean=19.65 min=13 max=27 statistics Test.node foo:stats count=100 mean=19.65 min=13 max=27 histogram Test.node foo:histogram count=100 mean=19.65 min=13 max=27 #bins=24 ------------------------ $ scavetool -l -w General-0-xxxx: scalar Test.node foo:mean 19.84 scalar Test.node foo:last 17 scalar Test.node foo:stats:count 100 scalar Test.node foo:stats:mean 19.84 scalar Test.node foo:stats:stddev 3.15499 scalar Test.node foo:stats:min 12 scalar Test.node foo:stats:max 28 scalar Test.node foo:stats:sum 1984 scalar Test.node foo:histogram:count 100 scalar Test.node foo:histogram:mean 19.84 scalar Test.node foo:histogram:stddev 3.15499 scalar Test.node foo:histogram:min 12 scalar Test.node foo:histogram:max 28 scalar Test.node foo:histogram:sum 1984 vector Test.node foo:vector vectorId=0 count=100 mean=19.84 min=12 max=28 statistics Test.node foo:stats count=100 mean=19.84 min=12 max=28 histogram Test.node foo:histogram count=100 mean=19.84 min=12 max=28 #bins=26 General-1-xxxx: scalar Test.node foo:mean 19.65 scalar Test.node foo:last 19 scalar Test.node foo:stats:count 100 scalar Test.node foo:stats:mean 19.65 scalar Test.node foo:stats:stddev 3.33447 scalar Test.node foo:stats:min 13 scalar Test.node foo:stats:max 27 scalar Test.node foo:stats:sum 1965 scalar Test.node foo:histogram:count 100 scalar Test.node foo:histogram:mean 19.65 scalar Test.node foo:histogram:stddev 3.33447 scalar Test.node foo:histogram:min 13 scalar Test.node foo:histogram:max 27 scalar Test.node foo:histogram:sum 1965 vector Test.node foo:vector vectorId=0 count=100 mean=19.65 min=13 max=27 statistics Test.node foo:stats count=100 mean=19.65 min=13 max=27 histogram Test.node foo:histogram count=100 mean=19.65 min=13 max=27 #bins=24 ------------------------ $ scavetool -r --rundisplay runnumber General 0 General 1 ------------------------ $ scavetool -r -D runid General-0-xxxx General-1-xxxx ------------------------ $ scavetool -r -D runnumber General 0 General 1 ------------------------ $ scavetool -r -D itervars General null 0 General null 1 ------------------------ $ scavetool -r -D experiment General null #0 General null #1 ------------------------ $ scavetool -k runs: 2 scalars: 4 vectors: 2 statistics: 2 histograms: 2 ------------------------ $ scavetool --no-indexing runs: 2 scalars: 4 vectors: 2 statistics: 2 histograms: 2 ------------------------ $ scavetool -v reading results/General-#0.sca... done reading results/General-#1.sca... done reading results/General-#0.vec... done reading results/General-#1.vec... done 4 file(s) loaded runs: 2 scalars: 4 vectors: 2 statistics: 2 histograms: 2 ------------------------ $ scavetool --verbose reading results/General-#0.sca... done reading results/General-#1.sca... done reading results/General-#0.vec... done reading results/General-#1.vec... done 4 file(s) loaded runs: 2 scalars: 4 vectors: 2 statistics: 2 histograms: 2 .