Small test comments cleanup.

Small test comments cleanup.

:- include(misc(common)).

:- begin_tests('bson_encoder:term_to_bson/2').

test('empty doc', [true(Got == Expected)]) :-
    Term =
    [
    ],
    Expected =
    [
        5,0,0,0, % Length of top doc.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('float', [true(Got == Expected)]) :-
    Term =
    [
        hello: 5.05
    ],
    Expected =
    [
        20,0,0,0, % Length of top doc.
        0x01, % Tag.
            104,101,108,108,111, 0, % Ename.
            51,51,51,51, 51,51,20,64, % Double data.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('string', [true(Got == Expected)]) :-
    Term =
    [
        'ä': 'ä\0ä'
    ],
    Expected =
    [
        19,0,0,0, % Length of top doc.
        0x02, % Tag.
            0xc3,0xa4, 0, % Ename.
            6,0,0,0, % String length incl. nul.
            0xc3,0xa4, 0, 0xc3,0xa4, 0, % String data.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('int32 positive', [true(Got == Expected)]) :-
    Term =
    [
        hello: 32
    ],
    Expected =
    [
        16,0,0,0, % Length of top doc.
        0x10, % Tag.
            104,101,108,108,111, 0, % Ename.
            32,0,0,0, % Int32 data.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('int32 negative', [true(Got == Expected)]) :-
    Term =
    [
        hello: -32
    ],
    Expected =
    [
        16,0,0,0, % Length of top doc.
        0x10, % Tag.
            104,101,108,108,111, 0, % Ename.
            0xE0,0xFF,0xFF,0xFF, % Int32 data.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('int64 positive', [true(Got == Expected)]) :-
    Term =
    [
        hello: 9223372036854775807
    ],
    Expected =
    [
        20,0,0,0, % Length of top doc.
        0x12, % Tag.
            104,101,108,108,111, 0, % Ename.
            0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0x7F, % Int64 data.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('int64 negative', [true(Got == Expected)]) :-
    Term =
    [
        hello: -9223372036854775808
    ],
    Expected =
    [
        20,0,0,0, % Length of top doc.
        0x12, % Tag.
            104,101,108,108,111, 0, % Ename.
            0,0,0,0, 0,0,0,0x80, % Int64 data.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('embedded doc', [true(Got == Expected)]) :-
    Term =
    [
        'BSON':
            [
                'a': 'awesome',
                'b': 5.05,
                'c': 1986
            ]
    ],
    Expected =
    [
        49,0,0,0, % Length of top doc.
        0x03, % Tag.
            66,83,79,78, 0, % Ename.
            38,0,0,0, % Length of embedded doc.
            0x02, % Tag.
                97, 0, % Ename.
                8,0,0,0, % String's byte length, incl. nul.
                97,119,101,115,111,109,101, 0, % String data.
            0x01, % Tag.
                98, 0, % Ename.
                51,51,51,51,51,51,20,64, % Double 8-byte data.
            0x10, % Tag.
                99, 0, % Ename.
                194,7,0,0, % Int32 data.
            0, % End of embedded doc.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('embedded array', [true(Got == Expected)]) :-
    Term =
    [
        'BSON':
            [
                'awesome',
                5.05,
                1986
            ]
    ],
    Expected =
    [
        49,0,0,0, % Length of top doc.
        0x04, % Tag.
            66,83,79,78, 0, % Ename.
            38,0,0,0, % Length of embedded doc.
            0x02, % Tag.
                48, 0, % Ename, index 0.
                8,0,0,0, % String's byte length, incl. nul.
                97,119,101,115,111,109,101, 0, % String data.
            0x01, % Tag.
                49, 0, % Ename, index 1.
                51,51,51,51,51,51,20,64, % Double 8-byte data.
            0x10, % Tag.
                50, 0, % Ename, index 2.
                194,7,0,0, % Int32 data.
            0, % End of embedded doc.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('null', [true(Got == Expected)]) :-
    Term =
    [
        hello: null
    ],
    Expected =
    [
        12,0,0,0, % Length of top doc.
        0x0A, % Tag.
            104,101,108,108,111, 0, % Ename.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('boolean false', [true(Got == Expected)]) :-
    Term =
    [
        hello: false
    ],
    Expected =
    [
        13,0,0,0, % Length of top doc.
        0x08, % Tag.
            104,101,108,108,111, 0, % Ename.
            0, % Boolean data.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('boolean true', [true(Got == Expected)]) :-
    Term =
    [
        hello: true
    ],
    Expected =
    [
        13,0,0,0, % Length of top doc.
        0x08, % Tag.
            104,101,108,108,111, 0, % Ename.
            1, % Boolean data.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('undefined', [true(Got == Expected)]) :-
    Term =
    [
        hello: undefined
    ],
    Expected =
    [
        12,0,0,0, % Length of top doc.
        0x06, % Tag.
            104,101,108,108,111, 0, % Ename.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('min', [true(Got == Expected)]) :-
    Term =
    [
        hello: min
    ],
    Expected =
    [
        12,0,0,0, % Length of top doc.
        0xFF, % Tag.
            104,101,108,108,111, 0, % Ename.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('max', [true(Got == Expected)]) :-
    Term =
    [
        hello: max
    ],
    Expected =
    [
        12,0,0,0, % Length of top doc.
        0x7F, % Tag.
            104,101,108,108,111, 0, % Ename.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('invalid', [throws(bson_error(invalid))]) :-
    Term = invalid_bson,
    bson_encoder:term_to_bson(Term, _Got).

:- end_tests('bson_encoder:term_to_bson/2').

:- include(misc(common)).

:- begin_tests('bson_encoder:term_to_bson/2').

test('empty doc', [true(Got == Expected)]) :-
    Term =
    [
    ],
    Expected =
    [
        5,0,0,0, % Length of top doc.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('float', [true(Got == Expected)]) :-
    Term =
    [
        hello: 5.05
    ],
    Expected =
    [
        20,0,0,0, % Length of top doc.
        0x01, % Double tag.
            104,101,108,108,111, 0, % Ename "hello\0".
            51,51,51,51, 51,51,20,64, % Double data, 5.05.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('string', [true(Got == Expected)]) :-
    Term =
    [
        'ä': 'ä\0ä'
    ],
    Expected =
    [
        19,0,0,0, % Length of top doc.
        0x02, % String tag.
            0xc3,0xa4, 0, % Ename, "ä\0".
            6,0,0,0, % String length incl. nul.
            0xc3,0xa4, 0, 0xc3,0xa4, 0, % String data, "ä\0ä\0".
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('int32 positive', [true(Got == Expected)]) :-
    Term =
    [
        hello: 32
    ],
    Expected =
    [
        16,0,0,0, % Length of top doc.
        0x10, % Int32 tag.
            104,101,108,108,111, 0, % Ename "hello\0".
            32,0,0,0, % Int32 data, 32.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('int32 negative', [true(Got == Expected)]) :-
    Term =
    [
        hello: -32
    ],
    Expected =
    [
        16,0,0,0, % Length of top doc.
        0x10, % Int32 tag.
            104,101,108,108,111, 0, % Ename "hello\0".
            0xE0,0xFF,0xFF,0xFF, % Int32 data, -32.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('int64 positive', [true(Got == Expected)]) :-
    Term =
    [
        hello: 9223372036854775807
    ],
    Expected =
    [
        20,0,0,0, % Length of top doc.
        0x12, % Int32 tag.
            104,101,108,108,111, 0, % Ename.
            0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0x7F, % Int64 data.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('int64 negative', [true(Got == Expected)]) :-
    Term =
    [
        hello: -9223372036854775808
    ],
    Expected =
    [
        20,0,0,0, % Length of top doc.
        0x12, % Int64 tag.
            104,101,108,108,111, 0, % Ename.
            0,0,0,0, 0,0,0,0x80, % Int64 data.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('embedded doc', [true(Got == Expected)]) :-
    Term =
    [
        'BSON':
            [
                'a': 'awesome',
                'b': 5.05,
                'c': 1986
            ]
    ],
    Expected =
    [
        49,0,0,0, % Length of top doc.
        0x03, % Embedded doc tag.
            66,83,79,78, 0, % Ename "BSON\0".
            38,0,0,0, % Length of embedded doc (array).
            0x02, % String tag.
                97, 0, % Ename ("a\0").
                8,0,0,0, % String's byte length, incl. nul.
                97,119,101,115,111,109,101, 0, % String data, "awesome\0".
            0x01, % Double tag.
                98, 0, % Ename ("b\0").
                51,51,51,51,51,51,20,64, % Double 8-byte data, 5.05.
            0x10, % Int32 tag.
                99, 0, % Ename ("c\0").
                194,7,0,0, % Int32 data, 1986.
            0, % End of embedded doc (array).
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('embedded array', [true(Got == Expected)]) :-
    Term =
    [
        'BSON':
            [
                'awesome',
                5.05,
                1986
            ]
    ],
    Expected =
    [
        49,0,0,0, % Length of top doc.
        0x04, % Array tag.
            66,83,79,78, 0, % Ename "BSON\0".
            38,0,0,0, % Length of embedded doc (array).
            0x02, % String tag.
                48, 0, % Ename, index 0 ("0\0").
                8,0,0,0, % String's byte length, incl. nul.
                97,119,101,115,111,109,101, 0, % String data, "awesome\0".
            0x01, % Double tag.
                49, 0, % Ename, index 1 ("1\0").
                51,51,51,51,51,51,20,64, % Double 8-byte data, 5.05.
            0x10, % Int32 tag.
                50, 0, % Ename, index 2 ("2\0").
                194,7,0,0, % Int32 data, 1986.
            0, % End of embedded doc (array).
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('null', [true(Got == Expected)]) :-
    Term =
    [
        hello: null
    ],
    Expected =
    [
        12,0,0,0, % Length of top doc.
        0x0A, % Null tag.
            104,101,108,108,111, 0, % Ename "hello\0".
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('boolean false', [true(Got == Expected)]) :-
    Term =
    [
        hello: false
    ],
    Expected =
    [
        13,0,0,0, % Length of top doc.
        0x08, % Boolean tag.
            104,101,108,108,111, 0, % Ename "hello\0".
            0, % Boolean data, false.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('boolean true', [true(Got == Expected)]) :-
    Term =
    [
        hello: true
    ],
    Expected =
    [
        13,0,0,0, % Length of top doc.
        0x08, % Boolean tag.
            104,101,108,108,111, 0, % Ename "hello\0".
            1, % Boolean data, true.
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('undefined', [true(Got == Expected)]) :-
    Term =
    [
        hello: undefined
    ],
    Expected =
    [
        12,0,0,0, % Length of top doc.
        0x06, % Undefined tag.
            104,101,108,108,111, 0, % Ename "hello\0".
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('min', [true(Got == Expected)]) :-
    Term =
    [
        hello: min
    ],
    Expected =
    [
        12,0,0,0, % Length of top doc.
        0xFF, % Min tag.
            104,101,108,108,111, 0, % Ename "hello\0".
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('max', [true(Got == Expected)]) :-
    Term =
    [
        hello: max
    ],
    Expected =
    [
        12,0,0,0, % Length of top doc.
        0x7F, % Max tag.
            104,101,108,108,111, 0, % Ename "hello\0".
        0 % End of top doc.
    ],
    bson_encoder:term_to_bson(Term, Got).

test('invalid', [throws(bson_error(invalid))]) :-
    Term = invalid,
    bson_encoder:term_to_bson(Term, _Got).

:- end_tests('bson_encoder:term_to_bson/2').


forgot a "p"

forgot a "p"

set origin 0.05,0.05
set tics font ",18"
set xtics 100
set size 0.9,0.9

set xrange [400:1000]

set xlabel 'Wavelength/nm'
set ylabel 'Arbitrary Intensity /unit'

plot ".temp" u 1:2 w p ps 0.2 pt 7 lc rgb '#212121' notitle
pause 1
reread

set origin 0.05,0.05
set tics font ",18"
set xtics 100
set size 0.9,0.9

set xrange [400:1000]

set xlabel 'Wavelength/nm'
set ylabel 'Arbitrary Intensity /unit'

plot ".temp" u 1:2 w ps 0.2 pt 7 lc rgb '#212121' notitle
pause 1
reread


Made this script work

Made this script work

git-svn-id: b233c5b81dcfbfdfca783093b3213ccfd2356b3a@553 3eb578c0-666c-0410-8428-3510748880ad

set terminal png
set yr[0:]
set output "../planar-axiall5b4.d0g1.d-2DF.png"
plot "../planar-axiall5b4.d0DF.txt" using 2:5, "../analytical_data/BBR_axial_mix.txt" using 1:3 every ::66::76

set output "../planar-biaxiall5b4.d0g1.d-2DF.png"
plot "../planar-biaxiall5b4.d0DF.txt" using 2:5, "../analytical_data/BBR_biaxial_mix.txt" using 1:3 every ::66::76

set terminal png
set yr[0:]
set output "../planar-axiall6b6.d0g1.d-3DF.png"
plot "../planar-axiall6b6.d0DF.txt" using 2:5 every ::33::43, "../analytical_data/BBR_axial_mix.txt" using 1:3 every ::33::43

set output "../planar-axiall6b6.d0g1.d-2DF.png"
plot "../planar-axiall6b6.d0DF.txt" using 2:5 every ::66::76, "../analytical_data/BBR_axial_mix.txt" using 1:3 every ::66::76

set output "../planar-axiall6b6.d0g1.d-1DF.png"
plot "../planar-axiall6b6.d0DF.txt" using 2:5 every ::99::108, "../analytical_data/BBR_axial_mix.txt" using 1:3 every ::99::108

set output "../planar-biaxiall6b6.d0g1.d-3DF.png"
plot "../planar-biaxiall6b6.d0DF.txt" using 2:5 every ::33::43, "../analytical_data/BBR_biaxial_mix.txt" using 1:3 every ::33::43

set output "../planar-biaxiall6b6.d0g1.d-2DF.png"
plot "../planar-biaxiall6b6.d0DF.txt" using 2:5 every ::66::76, "../analytical_data/BBR_biaxial_mix.txt" using 1:3 every ::66::76

set output "../planar-biaxiall6b6.d0g1.d-1DF.png"
plot "../planar-biaxiall6b6.d0DF.txt" using 2:5 every ::99::108, "../analytical_data/BBR_biaxial_mix.txt" using 1:3 every ::99::108


updating boinc_software/monitor-boinc-server/general-activity/archive/plotData_restart.gnu to retrieve data from both 2017 and 2018

reset

restartFile='/home/amereghe/Documents/notebooks/simulations/code development/general notes/boinc/monitoring restarts/restart.txt/restart.txt'
stuckFile='../assimilatorStuck.txt'
restaFile='../assimilatorRestart.txt'

set xdata time
set timefmt '%Y-%m-%d %H:%M:%S'
# set format x '%Y-%m-%d'
set format x '%Y-%m-%d %H:%M'
set xtics 3600*24 rotate by 90 right
set grid xtics lt 0 lw 1
# tMin=strptime("%Y-%m-%d %H:%M:%S","2017-02-01 00:00:00")
# tMin=strptime("%Y-%m-%d %H:%M:%S","2017-06-15 00:00:00")
tMin=strptime("%Y-%m-%d %H:%M:%S","2017-12-10 00:00:00")
set xrange [tMin:*]
ybar=300
M=0.1
# typical enlarged window size: 1900,400
# trigger use of png or interactive windows: 0: png, 1: interactive
linteractive=0
lprintDate=0 # 0: no date/time in png name; 1: date/time in png name
xSizeWdw=1600#regular: 1000
ySizeWdw=400#regular: 400

if ( lprintDate==0 ) {
rightNowPNG=''
} else {
rightNowPNG=system('date +"_%F_%H-%M-%S"')
}

# ------------------------------------------------------------------------------
# general overview of server status
# ------------------------------------------------------------------------------
currTitle='server overview'
if ( linteractive==0 ) {
set term png font "Times-Roman" size xSizeWdw,ySizeWdw notransparent enhanced
set output '/home/amereghe/Downloads/boincStatus/serverOverview'.rightNowPNG.'.png'
} else {
set term qt 0 title currTitle font "Times-Roman" size xSizeWdw,ySizeWdw
}
set multiplot title currTitle
set key outside horizontal
set ylabel 'tasks in progress/ready to send [10^3]'
set ytics nomirror
set y2label 'tasks waiting for assimilation' tc rgb 'blue'
set y2tics tc rgb 'blue'
nLines=system("wc -l ".restaFile." | awk '{print ($1)}'")
plot \
     '< cat 201[7-8]-??/server_status_????-??.dat' index 0 using 1:($4/1000) with linespoints pt 7 ps 1 lt 1 lw 1 lc rgb 'red' title 'in progress',\
     ''               index 0 using 1:($3/1000*M) with linespoints pt 7 ps 1 lt 2 lw 1 lc rgb 'green' title 'ready to send '.gprintf('(x%.1f)',1.0/M),\
     ''               index 0 using 1:6 with linespoints axis x1y2 pt 7 ps 1 lt 2 lw 1 lc rgb 'blue' notitle,\
     restartFile index 0 using 1:(ybar) with impulses lt -1 lw 2 notitle,\
     '< paste '.stuckFile.' '.restaFile.' | head -n'.nLines index 0 using 1:(0.5*ybar):1:3 with xerrorbars lt -1 lw 1 notitle

unset grid
set grid ytics lt 0 lw 1
replot
unset grid
set grid y2tics lt 0 lw 1 lc rgb 'blue'
replot
unset multiplot

# credit
currTitle='credit'
if ( linteractive==0 ) {
set term png font "Times-Roman" size xSizeWdw,ySizeWdw notransparent enhanced
set output '/home/amereghe/Downloads/boincStatus/creditOverview'.rightNowPNG.'.png'
} else {
set term qt 1 title currTitle font "Times-Roman" size xSizeWdw,ySizeWdw
}
set title currTitle
set key outside horizontal
set ylabel 'recent credit (users/computers) [10^3]' tc rgb 'red'
set ytics nomirror tc rgb 'red'
set y2label 'total credit (users/computers) [10^3]' tc rgb 'magenta'
set y2tics tc rgb 'magenta'
set grid xtics ytics lt 0 lw 1 lc rgb 'black'
plot \
     '< cat 201[7-8]-??/server_status_????-??.dat' index 0 using 1:($10/1000) with linespoints pt 7 ps 1 lt 1 lw 1 lc rgb 'red' title 'users',\
     ''               index 0 using 1:($13/1000) with linespoints pt 7 ps 1 lt 1 lw 1 lc rgb 'blue' title 'computers',\
     ''               index 0 using 1:($11/1000) with linespoints axis x1y2 pt 7 ps 1 lt 1 lw 1 lc rgb 'magenta' notitle,\
     ''               index 0 using 1:($14/1000) with linespoints axis x1y2 pt 7 ps 1 lt 1 lw 1 lc rgb 'cyan' notitle

# gigaflops
currTitle='TeraFLOPs'
if ( linteractive==0 ) {
set term png font "Times-Roman" size xSizeWdw,ySizeWdw notransparent enhanced
set output '/home/amereghe/Downloads/boincStatus/teraFLOPsOverview'.rightNowPNG.'.png'
} else {
set term qt 2 title currTitle font "Times-Roman" size xSizeWdw,ySizeWdw
}
set title currTitle
set key outside horizontal
set ylabel 'TeraFLOPs []' tc rgb 'black'
set ytics mirror tc rgb 'black'
unset y2label
unset y2tics
set grid xtics ytics lt 0 lw 1 lc rgb 'black'
plot \
     '< cat 201[7-8]-??/server_status_????-??.dat' index 0 using 1:($16/1000) with linespoints pt 7 ps 1 lt 1 lw 1 lc rgb 'red' notitle
unset title

# WUs waiting for validation
currTitle='Validation'
if ( linteractive==0 ) {
set term png font "Times-Roman" size xSizeWdw,ySizeWdw notransparent enhanced
set output '/home/amereghe/Downloads/boincStatus/validationOverview'.rightNowPNG.'.png'
} else {
set term qt 3 title currTitle font "Times-Roman" size xSizeWdw,ySizeWdw
}
set title currTitle
set key outside horizontal
set ylabel 'WUs waiting for validation []' tc rgb 'black'
set ytics mirror tc rgb 'black'
unset y2label
unset y2tics
set grid xtics ytics lt 0 lw 1 lc rgb 'black'
plot \
     '< cat 201[7-8]-??/server_status_????-??.dat' index 0 using 1:5 with linespoints pt 7 ps 1 lt 1 lw 1 lc rgb 'red' notitle
unset title

# ------------------------------------------------------------------------------
# sixtrack
# ------------------------------------------------------------------------------
currTitle='SixTrack app'
if ( linteractive==0 ) {
set term png font "Times-Roman" size xSizeWdw,ySizeWdw notransparent enhanced
set output '/home/amereghe/Downloads/boincStatus/sixtrackOverview'.rightNowPNG.'.png'
} else {
set term qt 4 title currTitle font "Times-Roman" size xSizeWdw,ySizeWdw
}
set multiplot title currTitle
set key outside horizontal
set ylabel 'tasks in progress/unsent [10^3]'
set ytics nomirror
set y2label 'users in last 24h' tc rgb 'blue'
set y2tics tc rgb 'blue'
set xtics rotate by 90 right
set grid xtics lt 0 lw 1
plot \
     '< cat 201[7-8]-??/SixTrack_status_????-??.dat' index 0 using 1:($4/1000) with linespoints pt 7 ps 1 lt 1 lw 1 lc rgb 'red' title 'in progress',\
     ''               index 0 using 1:($3/1000*M) with linespoints pt 7 ps 1 lt 2 lw 1 lc rgb 'green' title 'ready to send '.gprintf('(x%.1f)',1.0/M),\
     ''               index 0 using 1:5 with linespoints axis x1y2 pt 7 ps 1 lt 2 lw 1 lc rgb 'blue' notitle
unset grid
set grid ytics lt 0 lw 1
replot
unset grid
set grid y2tics lt 0 lw 1 lc rgb 'blue'
replot
unset multiplot

# ------------------------------------------------------------------------------
# sixtracktest
# ------------------------------------------------------------------------------
currTitle='sixtracktest app'
if ( linteractive==0 ) {
set term png font "Times-Roman" size xSizeWdw,ySizeWdw notransparent enhanced
set output '/home/amereghe/Downloads/boincStatus/sixtracktestOverview'.rightNowPNG.'.png'
} else {
set term qt 5 title currTitle font "Times-Roman" size xSizeWdw,ySizeWdw
}
set multiplot title currTitle
set key outside horizontal
set ylabel 'tasks in progress/unsent [10^3]'
set ytics nomirror
set y2label 'users in last 24h' tc rgb 'blue'
set y2tics tc rgb 'blue'
set xtics rotate by 90 right
set grid xtics lt 0 lw 1
plot \
     '< cat 201[7-8]-??/sixtracktest_status_????-??.dat' index 0 using 1:($4/1000) with linespoints pt 7 ps 1 lt 1 lw 1 lc rgb 'red' title 'in progress',\
     ''               index 0 using 1:($3/1000*M) with linespoints pt 7 ps 1 lt 2 lw 1 lc rgb 'green' title 'ready to send '.gprintf('(x%.1f)',1.0/M),\
     ''               index 0 using 1:5 with linespoints axis x1y2 pt 7 ps 1 lt 2 lw 1 lc rgb 'blue' notitle
unset grid
set grid ytics lt 0 lw 1
replot
unset grid
set grid y2tics lt 0 lw 1 lc rgb 'blue'
replot
unset multiplot

reset

restartFile='/home/amereghe/Documents/notebooks/simulations/code development/general notes/boinc/monitoring restarts/restart.txt/restart.txt'
stuckFile='../assimilatorStuck.txt'
restaFile='../assimilatorRestart.txt'

set xdata time
set timefmt '%Y-%m-%d %H:%M:%S'
set format x '%Y-%m-%d %H:%M'
set xtics 3600*24 rotate by 90 right
set grid xtics lt 0 lw 1
tMin=strptime("%Y-%m-%d %H:%M:%S","2017-06-15 00:00:00")
set xrange [tMin:*]
ybar=500
M=0.1
# typical enlarged window size: 1900,400
# trigger use of png or interactive windows: 0: png, 1: interactive
linteractive=1
lprintDate=0 # 0: no date/time in png name; 1: date/time in png name
xSizeWdw=1200#regular: 1000
ySizeWdw=400#regular: 400

if ( lprintDate==0 ) {
rightNowPNG=''
} else {
rightNowPNG=system('date +"_%F_%H-%M-%S"')
}

# ------------------------------------------------------------------------------
# general overview of server status
# ------------------------------------------------------------------------------
currTitle='server overview'
if ( linteractive==0 ) {
set term png font "Times-Roman" size xSizeWdw,ySizeWdw notransparent enhanced
set output '/home/amereghe/Downloads/boincStatus/serverOverview'.rightNowPNG.'.png'
} else {
set term qt 0 title currTitle font "Times-Roman" size xSizeWdw,ySizeWdw
}
set multiplot title currTitle
set key outside horizontal
set ylabel 'tasks in progress/ready to send [10^3]'
set ytics nomirror
set y2label 'tasks waiting for assimilation' tc rgb 'blue'
set y2tics tc rgb 'blue'
nLines=system("wc -l ".restaFile." | awk '{print ($1)}'")
plot \
     '< cat 2017-??/server_status_????-??.dat' index 0 using 1:($4/1000) with linespoints pt 7 ps 1 lt 1 lw 1 lc rgb 'red' title 'in progress',\
     ''               index 0 using 1:($3/1000*M) with linespoints pt 7 ps 1 lt 2 lw 1 lc rgb 'green' title 'ready to send '.gprintf('(x1/%.1f)',M),\
     ''               index 0 using 1:6 with linespoints axis x1y2 pt 7 ps 1 lt 2 lw 1 lc rgb 'blue' notitle,\
     restartFile index 0 using 1:(ybar) with impulses lt -1 lw 2 notitle,\
     '< paste '.stuckFile.' '.restaFile.' | head -n'.nLines index 0 using 1:(0.5*ybar):1:3 with xerrorbars lt -1 lw 1 notitle

unset grid
set grid ytics lt 0 lw 1
replot
unset grid
set grid y2tics lt 0 lw 1 lc rgb 'blue'
replot
unset multiplot

# credit
currTitle='credit'
if ( linteractive==0 ) {
set term png font "Times-Roman" size xSizeWdw,ySizeWdw notransparent enhanced
set output '/home/amereghe/Downloads/boincStatus/creditOverview'.rightNowPNG.'.png'
} else {
set term qt 1 title currTitle font "Times-Roman" size xSizeWdw,ySizeWdw
}
set title currTitle
set key outside horizontal
set ylabel 'recent credit (users/computers) [10^3]' tc rgb 'red'
set ytics nomirror tc rgb 'red'
set y2label 'total credit (users/computers) [10^3]' tc rgb 'magenta'
set y2tics tc rgb 'magenta'
set grid xtics ytics lt 0 lw 1 lc rgb 'black'
plot \
     '< cat 2017-??/server_status_????-??.dat' index 0 using 1:($10/1000) with linespoints pt 7 ps 1 lt 1 lw 1 lc rgb 'red' title 'users',\
     ''               index 0 using 1:($13/1000) with linespoints pt 7 ps 1 lt 1 lw 1 lc rgb 'blue' title 'computers',\
     ''               index 0 using 1:($11/1000) with linespoints axis x1y2 pt 7 ps 1 lt 1 lw 1 lc rgb 'magenta' notitle,\
     ''               index 0 using 1:($14/1000) with linespoints axis x1y2 pt 7 ps 1 lt 1 lw 1 lc rgb 'cyan' notitle

# gigaflops
currTitle='TeraFLOPs'
if ( linteractive==0 ) {
set term png font "Times-Roman" size xSizeWdw,ySizeWdw notransparent enhanced
set output '/home/amereghe/Downloads/boincStatus/teraFLOPsOverview'.rightNowPNG.'.png'
} else {
set term qt 2 title currTitle font "Times-Roman" size xSizeWdw,ySizeWdw
}
set title currTitle
set key outside horizontal
set ylabel 'TeraFLOPs []' tc rgb 'black'
set ytics mirror tc rgb 'black'
unset y2label
unset y2tics
set grid xtics ytics lt 0 lw 1 lc rgb 'black'
plot \
     '< cat 2017-??/server_status_????-??.dat' index 0 using 1:($16/1000) with linespoints pt 7 ps 1 lt 1 lw 1 lc rgb 'red' notitle
unset title

# WUs waiting for validation
currTitle='Validation'
if ( linteractive==0 ) {
set term png font "Times-Roman" size xSizeWdw,ySizeWdw notransparent enhanced
set output '/home/amereghe/Downloads/boincStatus/validationOverview'.rightNowPNG.'.png'
} else {
set term qt 3 title currTitle font "Times-Roman" size xSizeWdw,ySizeWdw
}
set title currTitle
set key outside horizontal
set ylabel 'WUs waiting for validation []' tc rgb 'black'
set ytics mirror tc rgb 'black'
unset y2label
unset y2tics
set grid xtics ytics lt 0 lw 1 lc rgb 'black'
plot \
     '< cat 2017-??/server_status_????-??.dat' index 0 using 1:5 with linespoints pt 7 ps 1 lt 1 lw 1 lc rgb 'red' notitle
unset title

# ------------------------------------------------------------------------------
# sixtrack
# ------------------------------------------------------------------------------
currTitle='SixTrack app'
if ( linteractive==0 ) {
set term png font "Times-Roman" size xSizeWdw,ySizeWdw notransparent enhanced
set output '/home/amereghe/Downloads/boincStatus/sixtrackOverview'.rightNowPNG.'.png'
} else {
set term qt 4 title currTitle font "Times-Roman" size xSizeWdw,ySizeWdw
}
set multiplot title currTitle
set key outside horizontal
set ylabel 'tasks in progress/unsent [10^3]'
set ytics nomirror
set y2label 'users in last 24h' tc rgb 'blue'
set y2tics tc rgb 'blue'
set xtics rotate by 90 right
set grid xtics lt 0 lw 1
plot \
     '< cat 2017-??/SixTrack_status_????-??.dat' index 0 using 1:($4/1000) with linespoints pt 7 ps 1 lt 1 lw 1 lc rgb 'red' title 'in progress',\
     ''               index 0 using 1:($3/1000*M) with linespoints pt 7 ps 1 lt 2 lw 1 lc rgb 'green' title 'ready to send '.gprintf('(x1/%.1f)',M),\
     ''               index 0 using 1:5 with linespoints axis x1y2 pt 7 ps 1 lt 2 lw 1 lc rgb 'blue' notitle
unset grid
set grid ytics lt 0 lw 1
replot
unset grid
set grid y2tics lt 0 lw 1 lc rgb 'blue'
replot
unset multiplot

# ------------------------------------------------------------------------------
# sixtracktest
# ------------------------------------------------------------------------------
currTitle='sixtracktest app'
if ( linteractive==0 ) {
set term png font "Times-Roman" size xSizeWdw,ySizeWdw notransparent enhanced
set output '/home/amereghe/Downloads/boincStatus/sixtracktestOverview'.rightNowPNG.'.png'
} else {
set term qt 5 title currTitle font "Times-Roman" size xSizeWdw,ySizeWdw
}
set multiplot title currTitle
set key outside horizontal
set ylabel 'tasks in progress/unsent [10^3]'
set ytics nomirror
set y2label 'users in last 24h' tc rgb 'blue'
set y2tics tc rgb 'blue'
set xtics rotate by 90 right
set grid xtics lt 0 lw 1
plot \
     '< cat 2017-??/sixtracktest_status_????-??.dat' index 0 using 1:($4/1000) with linespoints pt 7 ps 1 lt 1 lw 1 lc rgb 'red' title 'in progress',\
     ''               index 0 using 1:($3/1000*M) with linespoints pt 7 ps 1 lt 2 lw 1 lc rgb 'green' title 'ready to send '.gprintf('(x1/%.1f)',M),\
     ''               index 0 using 1:5 with linespoints axis x1y2 pt 7 ps 1 lt 2 lw 1 lc rgb 'blue' notitle
unset grid
set grid ytics lt 0 lw 1
replot
unset grid
set grid y2tics lt 0 lw 1 lc rgb 'blue'
replot
unset multiplot


make: use gobjcopy if objcopy is not available

export GDBPREFIX ?= $(PREFIX)
export CC = $(PREFIX)gcc
export CXX = $(PREFIX)g++
ifeq ($(LTO),1)
export AR = $(PREFIX)gcc-ar
else
export AR = $(PREFIX)ar
endif
export AS = $(PREFIX)as
export LINK = $(PREFIX)gcc
export SIZE = $(PREFIX)size
export OBJCOPY = $(shell command -v $(PREFIX)objcopy gobjcopy objcopy | head -n 1)
ifeq ($(OBJCOPY),)
$(warning objcopy not found. Hex file will not be created.)
export OBJCOPY = true
endif
export OBJDUMP = $(PREFIX)objdump
export DBG = $(GDBPREFIX)gdb

export GDBPREFIX ?= $(PREFIX)
export CC = $(PREFIX)gcc
export CXX = $(PREFIX)g++
ifeq ($(LTO),1)
export AR = $(PREFIX)gcc-ar
else
export AR = $(PREFIX)ar
endif
export AS = $(PREFIX)as
export LINK = $(PREFIX)gcc
export SIZE = $(PREFIX)size
export OBJCOPY = $(PREFIX)objcopy
export OBJDUMP = $(PREFIX)objdump
export DBG = $(GDBPREFIX)gdb


graph12 update

graph12 update

#!/usr/bin/env gnuplot

# graph of CPU load

# datafiles
ifnameh = "/tmp/lnxdiagd/mysql4gnuplot/sql12h.csv"
ifnamed = "/tmp/lnxdiagd/mysql4gnuplot/sql12d.csv"
ifnamew = "/tmp/lnxdiagd/mysql4gnuplot/sql12w.csv"
set output "/tmp/lnxdiagd/site/img/day12.png"

# ******************************************************* General settings *****
set terminal png enhanced font "Vera,9" size 1280,320
set style fill solid 0.25 noborder
set datafile separator ';'
set datafile missing "NaN"    # Ignore missing values
set grid front
tz_offset = utc_offset / 3600 # GNUplot only works with UTC. Need to compensate
                              # for timezone ourselves.
if (GPVAL_VERSION == 4.6) {epoch_compensate = 946684800} else {if (GPVAL_VERSION == 5.0) {epoch_compensate = 0}}
# Positions of split between graphs
LMARG = 0.06
LMPOS = 0.40
MRPOS = 0.73
RMARG = 0.94

min(x,y) = (x < y) ? x : y
max(x,y) = (x > y) ? x : y

# ********************************************************* Statistics (R) *****
# stats to be calculated here of column 2 (UX-epoch)
stats ifnameh using 1 name "X" nooutput

Xh_min = X_min + utc_offset - epoch_compensate
Xh_max = X_max + utc_offset - epoch_compensate

# ********************************************************* Statistics (M) *****
# stats to be calculated here of column 2 (UX-epoch)
stats ifnamed using 1 name "X" nooutput

Xd_min = X_min + utc_offset - epoch_compensate
Xd_max = X_max + utc_offset - epoch_compensate

# ********************************************************* Statistics (L) *****
# stats to be calculated here of column 2 (UX-epoch)
stats ifnamew using 1 name "X" nooutput
Xw_min = X_min + utc_offset - epoch_compensate
Xw_max = X_max + utc_offset - epoch_compensate

set multiplot layout 1, 3 title "CPU Usage \\& Load ".strftime("( %Y-%m-%dT%H:%M:%S )", time(0)+utc_offset)

# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#                                                       LEFT PLOT: past week
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

# ***************************************************************** X-axis *****
set xlabel "past week"       # X-axis label
set xdata time               # Data on X-axis should be interpreted as time
set timefmt "%s"             # Time in log-file is given in Unix format
set format x "%a %d"            # Display time in 24 hour notation on the X axis
set xrange [ Xw_min : Xw_max ]

# ***************************************************************** Y-axis *****
set ylabel "Usage [%]"
set yrange [ 0 : 100 ]
set y2range [ 0 : 2 ]

# ***************************************************************** Legend *****
set key opaque box inside top left
set key samplen 0.1
set key reverse horizontal Left
set key maxcols 4

# ***************************************************************** Output *****
# set arrow from graph 0,graph 0 to graph 0,graph 1 nohead lc rgb "red" front
# set arrow from graph 1,graph 0 to graph 1,graph 1 nohead lc rgb "green" front
#set object 1 rect from screen 0,0 to screen 1,1 behind
#set object 1 rect fc rgb "#eeeeee" fillstyle solid 1.0 noborder
#set object 2 rect from graph 0,0 to graph 1,1 behind
#set object 2 rect fc rgb "#ffffff" fillstyle solid 1.0 noborder

set lmargin at screen LMARG
set rmargin at screen LMPOS

# ***** PLOT *****
set style data boxes
set style fill solid noborder

plot ifnamew \
      using ($1+utc_offset):($5+$6+$7+$8)     title "idle"    fc rgb "#229922"    \
  ,'' using ($1+utc_offset):($5+$6+$7)        title "waiting" fc "blue"           \
  ,'' using ($1+utc_offset):($5+$6)           title "system"  fc "yellow"         \
  ,'' using ($1+utc_offset):5                 title "user"    fc rgb "#ccbb0000"  \
  ,'' using ($1+utc_offset):2:4             notitle with filledcurves lc "black"  \
  ,'' using ($1+utc_offset):3                 title "load 5min" with lines lw 0.1 fc "black" axes x1y2

# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#                                                     MIDDLE PLOT:  past day
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

# ***************************************************************** X-axis *****
set xlabel "past day"       # X-axis label
set xdata time               # Data on X-axis should be interpreted as time
set timefmt "%s"             # Time in log-file is given in Unix format
set format x "%R"            # Display time in 24 hour notation on the X axis
set xrange [ Xd_min : Xd_max ]

# ***************************************************************** Y-axis *****
set ylabel " "
set ytics format " "
set yrange [ 0 : 100 ]
set y2range [ 0 : 2 ]

# ***************************************************************** Legend *****
unset key

# ***************************************************************** Output *****
set lmargin at screen LMPOS+0.001
set rmargin at screen MRPOS

# ***** PLOT *****
plot ifnamed \
      using ($1+utc_offset):($5+$6+$7+$8)     fc rgb "#229922"    \
  ,'' using ($1+utc_offset):($5+$6+$7)        fc "blue"           \
  ,'' using ($1+utc_offset):($5+$6)           fc "yellow"         \
  ,'' using ($1+utc_offset):5                 fc rgb "#ccbb0000"  \
  ,'' using ($1+utc_offset):2:4             notitle with filledcurves lc "black"  \
  ,'' using ($1+utc_offset):3                 with lines lw 0.1 fc "black" axes x1y2

# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#                                                      RIGHT PLOT: past hour
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

# ***************************************************************** X-axis *****
set xlabel "past hour"       # X-axis label
set xdata time               # Data on X-axis should be interpreted as time
set timefmt "%s"             # Time in log-file is given in Unix format
set format x "%R"            # Display time in 24 hour notation on the X axis
set xrange [ Xh_min : Xh_max ]
set xtics textcolor rgb "red"

# ***************************************************************** Y-axis *****
set ylabel " "
set ytics format " "
set yrange [ 0 : 100 ]

# **************************************************************** Y2-axis *****
set y2label "Load"
#set autoscale y2
set y2range [0:2]
set y2tics border

# ***************************************************************** Legend *****
unset key

# ***************************************************************** Output *****
set lmargin at screen MRPOS+0.001
set rmargin at screen RMARG

# ***** PLOT *****
plot ifnameh \
      using ($1+utc_offset):($3+$4+$5+$6)     fc rgb "#229922"    \
  ,'' using ($1+utc_offset):($3+$4+$5)        fc "blue"           \
  ,'' using ($1+utc_offset):($3+$4)           fc "yellow"         \
  ,'' using ($1+utc_offset):3                 fc rgb "#ccbb0000"  \
  ,'' using ($1+utc_offset):2                 with lines lw 0.1 fc "black" axes x1y2

# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#                                                                 FINALIZING
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

unset multiplot

#!/usr/bin/env gnuplot

# graph of CPU load

# datafiles
ifnameh = "/tmp/lnxdiagd/mysql4gnuplot/sql12h.csv"
ifnamed = "/tmp/lnxdiagd/mysql4gnuplot/sql12d.csv"
ifnamew = "/tmp/lnxdiagd/mysql4gnuplot/sql12w.csv"
set output "/tmp/lnxdiagd/site/img/day12.png"

# ******************************************************* General settings *****
set terminal png enhanced font "Vera,9" size 1280,320
set style fill solid 0.25 noborder
set datafile separator ';'
set datafile missing "NaN"    # Ignore missing values
set grid front
tz_offset = utc_offset / 3600 # GNUplot only works with UTC. Need to compensate
                              # for timezone ourselves.
if (GPVAL_VERSION == 4.6) {epoch_compensate = 946684800} else {if (GPVAL_VERSION == 5.0) {epoch_compensate = 0}}
# Positions of split between graphs
LMARG = 0.06
LMPOS = 0.40
MRPOS = 0.73
RMARG = 0.94

min(x,y) = (x < y) ? x : y
max(x,y) = (x > y) ? x : y

# ********************************************************* Statistics (R) *****
# stats to be calculated here of column 2 (UX-epoch)
stats ifnameh using 1 name "X" nooutput

Xh_min = X_min + utc_offset - epoch_compensate
Xh_max = X_max + utc_offset - epoch_compensate

# ********************************************************* Statistics (M) *****
# stats to be calculated here of column 2 (UX-epoch)
stats ifnamed using 1 name "X" nooutput

Xd_min = X_min + utc_offset - epoch_compensate
Xd_max = X_max + utc_offset - epoch_compensate

# ********************************************************* Statistics (L) *****
# stats to be calculated here of column 2 (UX-epoch)
stats ifnamew using 1 name "X" nooutput
Xw_min = X_min + utc_offset - epoch_compensate
Xw_max = X_max + utc_offset - epoch_compensate

set multiplot layout 1, 3 title "CPU Usage \\& Load ".strftime("( %Y-%m-%dT%H:%M:%S )", time(0)+utc_offset)

# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#                                                       LEFT PLOT: past week
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

# ***************************************************************** X-axis *****
set xlabel "past week"       # X-axis label
set xdata time               # Data on X-axis should be interpreted as time
set timefmt "%s"             # Time in log-file is given in Unix format
set format x "%a %d"            # Display time in 24 hour notation on the X axis
set xrange [ Xw_min : Xw_max ]

# ***************************************************************** Y-axis *****
set ylabel "Usage [%]"
set yrange [ 0 : 100 ]
set y2range [ 0 : 2 ]

# ***************************************************************** Legend *****
set key opaque box inside top left
set key samplen 0.1
set key reverse horizontal Left
set key maxcols 4

# ***************************************************************** Output *****
# set arrow from graph 0,graph 0 to graph 0,graph 1 nohead lc rgb "red" front
# set arrow from graph 1,graph 0 to graph 1,graph 1 nohead lc rgb "green" front
#set object 1 rect from screen 0,0 to screen 1,1 behind
#set object 1 rect fc rgb "#eeeeee" fillstyle solid 1.0 noborder
#set object 2 rect from graph 0,0 to graph 1,1 behind
#set object 2 rect fc rgb "#ffffff" fillstyle solid 1.0 noborder

set lmargin at screen LMARG
set rmargin at screen LMPOS

# ***** PLOT *****
set style data boxes
set style fill solid noborder

plot ifnamew \
      using ($1+utc_offset):($5+$6+$7+$8)     title "idle"    fc rgb "#229922"    \
  ,'' using ($1+utc_offset):($5+$6+$7)        title "waiting" fc "blue"           \
  ,'' using ($1+utc_offset):($5+$6)           title "system"  fc "yellow"         \
  ,'' using ($1+utc_offset):5                 title "user"    fc rgb "#ccbb0000"  \
  ,'' using ($1+utc_offset):2:4             notitle with filledcurves lc "black"  \
  ,'' using ($1+utc_offset):3                 title "load 5min" with lines lw 0.1 fc "black" axes x1y2

# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#                                                     MIDDLE PLOT:  past day
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

# ***************************************************************** X-axis *****
set xlabel "past day"       # X-axis label
set xdata time               # Data on X-axis should be interpreted as time
set timefmt "%s"             # Time in log-file is given in Unix format
set format x "%R"            # Display time in 24 hour notation on the X axis
set xrange [ Xd_min : Xd_max ]

# ***************************************************************** Y-axis *****
set ylabel " "
set ytics format " "
set yrange [ 0 : 100 ]
set y2range [ 0 : 2 ]

# ***************************************************************** Legend *****
unset key

# ***************************************************************** Output *****
set lmargin at screen LMPOS+0.001
set rmargin at screen MRPOS

# ***** PLOT *****
plot ifnamed \
      using ($1+utc_offset):($5+$6+$7+$8)     fc rgb "#229922"    \
  ,'' using ($1+utc_offset):($5+$6+$7)        fc "blue"           \
  ,'' using ($1+utc_offset):($5+$6)           fc "yellow"         \
  ,'' using ($1+utc_offset):5                 fc rgb "#ccbb0000"  \
  ,'' using ($1+utc_offset):2:4             notitle with filledcurves lc "black"  \
  ,'' using ($1+utc_offset):3                 with lines lw 0.1 fc "black" axes x1y2

# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#                                                      RIGHT PLOT: past hour
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

# ***************************************************************** X-axis *****
set xlabel "past hour"       # X-axis label
set xdata time               # Data on X-axis should be interpreted as time
set timefmt "%s"             # Time in log-file is given in Unix format
set format x "%R"            # Display time in 24 hour notation on the X axis
set xrange [ Xh_min : Xh_max ]
set xtics textcolor rgb "red"

# ***************************************************************** Y-axis *****
set ylabel " "
set ytics format " "
set yrange [ 0 : 100 ]

# **************************************************************** Y2-axis *****
set y2label "Load"
#set autoscale y2
set y2range [0:2]
set y2tics border

# ***************************************************************** Legend *****
unset key

# ***************************************************************** Output *****
set lmargin at screen MRPOS+0.001
set rmargin at screen RMARG

# ***** PLOT *****
plot ifnameh \
      using ($1+utc_offset):($5+$6+$7+$8)     fc rgb "#229922"    \
  ,'' using ($1+utc_offset):($5+$6+$7)        fc "blue"           \
  ,'' using ($1+utc_offset):($5+$6)           fc "yellow"         \
  ,'' using ($1+utc_offset):5                 fc rgb "#ccbb0000"  \
  ,'' using ($1+utc_offset):3                 with lines lw 0.1 fc "black" axes x1y2

# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#                                                                 FINALIZING
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

unset multiplot


Roomtemperature not showing

Roomtemperature not showing

#!/usr/bin/env gnuplot

# graph of various temperature sensors

# ******************************************************* General settings *****
set terminal png font "Helvetica" 11 size 640,480
set datafile separator ';'
set datafile missing "NaN"   # Ignore missing values
set grid
tz_offset = utc_offset / 3600 # GNUplot only works with UTC. Need to compensate
                              # for timezone ourselves.
set timestamp 'created: %Y-%m-%d %H:%M' bottom

# ************************************************************* Statistics *****
# stats to be calculated here
fname = "/tmp/sql25.csv"
stats fname using 2 name "T2" nooutput

T2_min = T2_min + utc_offset - 946684800
T2_max = T2_max + utc_offset - 946684800

# ****************************************************************** Title *****
set title "Temperature trends"
#"-".utc_offset."-"

# ***************************************************************** X-axis *****
set xlabel "Date/Time"       # X-axis label
set xdata time               # Define that data on X-axis should be interpreted as time
set timefmt "%s"             # Time in log-file is given in Unix format
set format x "%R"            # Display time in 24 hour notation on the X axis
set xtics rotate by 40 right
set xrange [ T2_min : T2_max ]

# ***************************************************************** Y-axis *****
set ylabel "Temperature [degC]"
#set yrange [10:20]
set autoscale y

# **************************************************************** Y2-axis *****
#set y2label "Raw values [mV]"
#set autoscale y2
#set y2tics border

# ***************************************************************** Legend *****
# generate a legend which is placed underneath the plot
#set key outside bottom center box title "-=legend=-"
set key default
set key box
set key samplen .2
set key inside vertical
set key left top

# ***************************************************************** Output *****
set object 1 rect from screen 0,0 to screen 1,1 behind
set object 1 rect fc rgb "#eeeeee" fillstyle solid 1.0 noborder
set object 2 rect from graph 0,0 to graph 1,1 behind
set object 2 rect fc rgb "#ffffff" fillstyle solid 1.0 noborder
set output "/tmp/bonediagd/Tdiag.png"

# ***** PLOT *****
plot "/tmp/sql25.csv"  using ($2+utc_offset):3 title "TMP36   [degC]"     with points pt 6 ps 0.2\
    ,"/tmp/sql22.csv"  using ($2+utc_offset):4 title "DHT22   [degC]"     with points pt 5 ps 0.2\
    ,"/tmp/sql23.csv"  using ($2+utc_offset):4 title "BMP183  [degC]"     with points pt 5 ps 0.2\
    ,"/tmp/sql24.csv"  using ($2+utc_offset):3 title "DS18B20 [degC]"     with points pt 5 ps 0.2\
#    ,"/tmp/sql21.csv"  using ($2+utc_offset):3 title "Room    [degC]"     with dots\

#!/usr/bin/env gnuplot

# graph of various temperature sensors

# ******************************************************* General settings *****
set terminal png font "Helvetica" 11 size 640,480
set datafile separator ';'
set datafile missing "NaN"   # Ignore missing values
set grid
tz_offset = utc_offset / 3600 # GNUplot only works with UTC. Need to compensate
                              # for timezone ourselves.
set timestamp 'created: %Y-%m-%d %H:%M' bottom

# ************************************************************* Statistics *****
# stats to be calculated here
fname = "/tmp/sql25.csv"
stats fname using 2 name "T2" nooutput

T2_min = T2_min + utc_offset - 946684800
T2_max = T2_max + utc_offset - 946684800

# ****************************************************************** Title *****
set title "Temperature trends"
#"-".utc_offset."-"

# ***************************************************************** X-axis *****
set xlabel "Date/Time"       # X-axis label
set xdata time               # Define that data on X-axis should be interpreted as time
set timefmt "%s"             # Time in log-file is given in Unix format
set format x "%R"            # Display time in 24 hour notation on the X axis
set xtics rotate by 40 right
set xrange [ T2_min : T2_max ]

# ***************************************************************** Y-axis *****
set ylabel "Temperature [degC]"
#set yrange [10:20]
set autoscale y

# **************************************************************** Y2-axis *****
#set y2label "Raw values [mV]"
#set autoscale y2
#set y2tics border

# ***************************************************************** Legend *****
# generate a legend which is placed underneath the plot
#set key outside bottom center box title "-=legend=-"
set key default
set key box
set key samplen .2
set key inside vertical
set key left top

# ***************************************************************** Output *****
set object 1 rect from screen 0,0 to screen 1,1 behind
set object 1 rect fc rgb "#eeeeee" fillstyle solid 1.0 noborder
set object 2 rect from graph 0,0 to graph 1,1 behind
set object 2 rect fc rgb "#ffffff" fillstyle solid 1.0 noborder
set output "/tmp/bonediagd/Tdiag.png"

# ***** PLOT *****
plot "/tmp/sql21.csv"  using ($2+utc_offset):3 title "Room    [degC]"     with points pt 6 ps 0.2\
    ,"/tmp/sql22.csv"  using ($2+utc_offset):4 title "DHT22   [degC]"     with points pt 5 ps 0.2\
    ,"/tmp/sql23.csv"  using ($2+utc_offset):4 title "BMP183  [degC]"     with points pt 5 ps 0.2\
    ,"/tmp/sql24.csv"  using ($2+utc_offset):3 title "DS18B20 [degC]"     with points pt 5 ps 0.2\
    ,"/tmp/sql25.csv"  using ($2+utc_offset):3 title "TMP36   [degC]"     with dots\


Add overcount percentage to overcounting.gnuplot

# Note you need gnuplot 4.4 for the pdfcairo terminal.

# set terminal pdfcairo font "Gill Sans,9" linewidth 4 rounded fontscale 1.0
set terminal pdfcairo font "Gill Sans,7" linewidth 1 rounded fontscale 1.0

# Line style for axes
set style line 80 lt rgb "#808080"

# Line style for grid
set style line 81 lt 0  # dashed
set style line 81 lt rgb "#808080"  # grey

set grid back linestyle 81
set border 3 back linestyle 80

set style line 1 lc rgb "#A00000" lw 2 pt 7 ps 0.5
set style line 2 lc rgb "#00A000" lw 2 pt 7 ps 0.5
set style line 3 lc rgb "#5060D0" lw 2 pt 7 ps 0.5

set output outputname
set xlabel "Clients"
set ylabel "Overcounted (%)"

set key bottom right

# set yrange [0:*]

# Titles with spaces are not allowed
# These titles should be separated by "_" and here we replace by " "
pretty(title) = system("echo ".title." | sed 's/_/ /g'")

# Input file contains comma-separated values fields
set datafile separator ","

plot for [i=0:words(inputnames) - 1] word(inputnames, i + 1) using 1:2 title pretty(word(titles, i + 1)) with linespoints ls i + 1

# Note you need gnuplot 4.4 for the pdfcairo terminal.

# set terminal pdfcairo font "Gill Sans,9" linewidth 4 rounded fontscale 1.0
set terminal pdfcairo font "Gill Sans,7" linewidth 1 rounded fontscale 1.0

# Line style for axes
set style line 80 lt rgb "#808080"

# Line style for grid
set style line 81 lt 0  # dashed
set style line 81 lt rgb "#808080"  # grey

set grid back linestyle 81
set border 3 back linestyle 80

set style line 1 lc rgb "#A00000" lw 2 pt 7 ps 0.5
set style line 2 lc rgb "#00A000" lw 2 pt 7 ps 0.5
set style line 3 lc rgb "#5060D0" lw 2 pt 7 ps 0.5

set output outputname
set xlabel "Clients"
set ylabel "Divergence"

set key bottom right

# set yrange [0:*]

# Titles with spaces are not allowed
# These titles should be separated by "_" and here we replace by " "
pretty(title) = system("echo ".title." | sed 's/_/ /g'")

# Input file contains comma-separated values fields
set datafile separator ","

plot for [i=0:words(inputnames) - 1] word(inputnames, i + 1) using 1:2 title pretty(word(titles, i + 1)) with linespoints ls i + 1


reverse key

reverse key

#!/usr/bin/env gnuplot

# graph of CPU load

# datafile
ifname = "/tmp/sql12.csv"
ofname = "/tmp/lnxdiagd/site/img/day12.png"

# ******************************************************* General settings *****
# set terminal png font "Vera" 11 size 640,480
set terminal png font "Courier" 10 size 640,304
set datafile separator ';'
set datafile missing "NaN"    # Ignore missing values
set grid front
tz_offset = utc_offset / 3600 # GNUplot only works with UTC. Need to compensate
                              # for timezone ourselves.
set timestamp 'created: %Y-%m-%d %H:%M' bottom

# ************************************************************* Statistics *****
# stats to be calculated here of column 2 (UX-epoch)
stats ifname using 2 name "X" nooutput

X_min = X_min + utc_offset - 946684800
X_max = X_max + utc_offset - 946684800

# ****************************************************************** Title *****
set title "CPU Load"

# ***************************************************************** X-axis *****
set xlabel "Date/Time"       # X-axis label
set xdata time               # Define that data on X-axis should be interpreted as time
set timefmt "%s"             # Time in log-file is given in Unix format
set format x "%R"            # Display time in 24 hour notation on the X axis
set xtics rotate by 40 right
set xrange [ X_min : X_max ]

# ***************************************************************** Y-axis *****
set ylabel "Usage [%]"
set yrange [0:100]
# set autoscale y

# **************************************************************** Y2-axis *****
set y2label "Load"
set autoscale y2
set y2tics border

# ***************************************************************** Legend *****
set key outside bottom center horizontal box reverse
set key samplen .2

# ***************************************************************** Output *****
# set arrow from graph 0,graph 0 to graph 0,graph 1 nohead lc rgb "red" front
# set arrow from graph 1,graph 0 to graph 1,graph 1 nohead lc rgb "green" front
set object 1 rect from screen 0,0 to screen 1,1 behind
set object 1 rect fc rgb "#eeeeee" fillstyle solid 1.0 noborder
set object 2 rect from graph 0,0 to graph 1,1 behind
set object 2 rect fc rgb "#ffffff" fillstyle solid 1.0 noborder
set output ofname

# ***** PLOT *****
set style data boxes
set style fill solid noborder
plot ifname \
       using ($2+utc_offset):($10+$11+$12+$13) title "idle"    fc "#229922" \
  , '' using ($2+utc_offset):($10+$11+$13)     title "waiting" fc "blue"    \
  , '' using ($2+utc_offset):($10+$11)         title "system"  fc "yellow"  \
  , '' using ($2+utc_offset):10                title "user"    fc "red"     \
  , '' using ($2+utc_offset):5                 title "load 5min" with dots lc "black" axes x1y2

#!/usr/bin/env gnuplot

# graph of CPU load

# datafile
ifname = "/tmp/sql12.csv"
ofname = "/tmp/lnxdiagd/site/img/day12.png"

# ******************************************************* General settings *****
# set terminal png font "Vera" 11 size 640,480
set terminal png font "Courier" 10 size 640,304
set datafile separator ';'
set datafile missing "NaN"    # Ignore missing values
set grid front
tz_offset = utc_offset / 3600 # GNUplot only works with UTC. Need to compensate
                              # for timezone ourselves.
set timestamp 'created: %Y-%m-%d %H:%M' bottom

# ************************************************************* Statistics *****
# stats to be calculated here of column 2 (UX-epoch)
stats ifname using 2 name "X" nooutput

X_min = X_min + utc_offset - 946684800
X_max = X_max + utc_offset - 946684800

# ****************************************************************** Title *****
set title "CPU Load"

# ***************************************************************** X-axis *****
set xlabel "Date/Time"       # X-axis label
set xdata time               # Define that data on X-axis should be interpreted as time
set timefmt "%s"             # Time in log-file is given in Unix format
set format x "%R"            # Display time in 24 hour notation on the X axis
set xtics rotate by 40 right
set xrange [ X_min : X_max ]

# ***************************************************************** Y-axis *****
set ylabel "Usage [%]"
set yrange [0:100]
# set autoscale y

# **************************************************************** Y2-axis *****
set y2label "Load"
set autoscale y2
set y2tics border

# ***************************************************************** Legend *****
set key outside bottom center horizontal box
set key samplen .2

# ***************************************************************** Output *****
# set arrow from graph 0,graph 0 to graph 0,graph 1 nohead lc rgb "red" front
# set arrow from graph 1,graph 0 to graph 1,graph 1 nohead lc rgb "green" front
set object 1 rect from screen 0,0 to screen 1,1 behind
set object 1 rect fc rgb "#eeeeee" fillstyle solid 1.0 noborder
set object 2 rect from graph 0,0 to graph 1,1 behind
set object 2 rect fc rgb "#ffffff" fillstyle solid 1.0 noborder
set output ofname

# ***** PLOT *****
set style data boxes
set style fill solid noborder
plot ifname \
       using ($2+utc_offset):($10+$11+$12+$13) title "idle"    fc "#229922" \
  , '' using ($2+utc_offset):($10+$11+$13)     title "waiting" fc "blue"    \
  , '' using ($2+utc_offset):($10+$11)         title "system"  fc "yellow"  \
  , '' using ($2+utc_offset):10                title "user"    fc "red"     \
  , '' using ($2+utc_offset):5                 title "load 5min" with dots lc "black" axes x1y2


20160406T2153

#!/usr/bin/env gnuplot

# graph of CPU load

# datafile
ifname = "/tmp/sql12.csv"
ofname = "/tmp/lnxdiagd/site/img/day12.png"

# ******************************************************* General settings *****
# set terminal png font "Vera" 11 size 640,480
set terminal png font "Courier" 10 size 640,304
set datafile separator ';'
set datafile missing "NaN"    # Ignore missing values
set grid
tz_offset = utc_offset / 3600 # GNUplot only works with UTC. Need to compensate
                              # for timezone ourselves.
set timestamp 'created: %Y-%m-%d %H:%M' bottom

# ************************************************************* Statistics *****
# stats to be calculated here of column 2 (UX-epoch)
stats ifname using 2 name "X" nooutput

X_min = X_min + utc_offset - 946684800
X_max = X_max + utc_offset - 946684800

# ****************************************************************** Title *****
set title "CPU Load"

# ***************************************************************** X-axis *****
set xlabel "Date/Time"       # X-axis label
set xdata time               # Define that data on X-axis should be interpreted as time
set timefmt "%s"             # Time in log-file is given in Unix format
set format x "%R"            # Display time in 24 hour notation on the X axis
set xtics rotate by 40 right
set xrange [ X_min : X_max ]

# ***************************************************************** Y-axis *****
set ylabel "Usage [%]"
set yrange [0:100]
# set autoscale y

# **************************************************************** Y2-axis *****
# set y2label "Load"
# set autoscale y2
# set y2tics border

# ***************************************************************** Legend *****
set key outside bottom center horizontal box
set key samplen .2

# ***************************************************************** Output *****
set arrow from graph 0,graph 0 to graph 0,graph 1 nohead lc rgb "red" front
set arrow from graph 1,graph 0 to graph 1,graph 1 nohead lc rgb "green" front
set object 1 rect from screen 0,0 to screen 1,1 behind
set object 1 rect fc rgb "#eeeeee" fillstyle solid 1.0 noborder
set object 2 rect from graph 0,0 to graph 1,1 behind
set object 2 rect fc rgb "#ffffff" fillstyle solid 1.0 noborder
set output ofname

# ***** PLOT *****
set style data boxes
set style fill solid noborder
plot ifname \
       using ($2+utc_offset):($10+$11+$12+$13) title "idle"    fc "green"\
  , '' using ($2+utc_offset):($10+$11+$13)     title "waiting" fc "blue" \
  , '' using ($2+utc_offset):($10+$11)         title "system"  fc "yellow"\
  , '' using ($2+utc_offset):10                title "user"    fc "red"

#!/usr/bin/env gnuplot

# graph of CPU load

# datafile
ifname = "/tmp/sql12.csv"
ofname = "/tmp/lnxdiagd/site/img/day12.png"

# ******************************************************* General settings *****
# set terminal png font "Vera" 11 size 640,480
set terminal png font "Courier" 10 size 640,304
set datafile separator ';'
set datafile missing "NaN"    # Ignore missing values
set grid
tz_offset = utc_offset / 3600 # GNUplot only works with UTC. Need to compensate
                              # for timezone ourselves.
set timestamp 'created: %Y-%m-%d %H:%M' bottom

# ************************************************************* Statistics *****
# stats to be calculated here of column 2 (UX-epoch)
stats ifname using 2 name "X" nooutput

X_min = X_min + utc_offset - 946684800
X_max = X_max + utc_offset - 946684800

# ****************************************************************** Title *****
set title "CPU Load"
#"-".utc_offset."-"

# ***************************************************************** X-axis *****
set xlabel "Date/Time"       # X-axis label
set xdata time               # Define that data on X-axis should be interpreted as time
set timefmt "%s"             # Time in log-file is given in Unix format
set format x "%R"            # Display time in 24 hour notation on the X axis
set xtics rotate by 40 right
set xrange [ X_min : X_max ]

# ***************************************************************** Y-axis *****
set ylabel "Usage [%]"
set yrange [0:100]
# set autoscale y

# **************************************************************** Y2-axis *****
# set y2label "Load"
# set autoscale y2
# set y2tics border

# ***************************************************************** Legend *****
set key outside bottom center horizontal box
set key samplen .2

# ***************************************************************** Output *****
set arrow from graph 0,graph 0 to graph 0,graph 1 nohead lc rgb "red" front
set arrow from graph 1,graph 0 to graph 1,graph 1 nohead lc rgb "green" front
set object 1 rect from screen 0,0 to screen 1,1 behind
set object 1 rect fc rgb "#eeeeee" fillstyle solid 1.0 noborder
set object 2 rect from graph 0,0 to graph 1,1 behind
set object 2 rect fc rgb "#ffffff" fillstyle solid 1.0 noborder
set output ofname

# ***** PLOT *****
#set style data histogram
#set style histogram columnstacked
set style data boxes
set style fill solid noborder
plot ifname \
       using ($2+utc_offset):($10+$11+$12+$13) title "waiting" fc "yellow"\
  , '' using ($2+utc_offset):($10+$11+$12)     title "idle" fc "green" \
  , '' using ($2+utc_offset):($10+$11)         title "system" fc "blue"\
  , '' using ($2+utc_offset):10                title "user" fc "red"
# plot ifname  using ($2+utc_offset):4 title " Temperature [degC]" with points pt 5 ps 0.2 \
#     ,       using ($2+utc_offset):4 title " Load [degC]" axes x1y2  with dots\


load is a thin line

load is a thin line

#!/usr/bin/env gnuplot

# graph of CPU load

# datafile
ifname = "/tmp/sql12.csv"
ofname = "/tmp/lnxdiagd/site/img/day12.png"

# ******************************************************* General settings *****
# set terminal png font "Vera" 11 size 640,480
set terminal png font "Vera" 10 size 640,304
set datafile separator ';'
set datafile missing "NaN"    # Ignore missing values
set grid front
tz_offset = utc_offset / 3600 # GNUplot only works with UTC. Need to compensate
                              # for timezone ourselves.
set timestamp 'created: %Y-%m-%d %H:%M' bottom

# ************************************************************* Statistics *****
# stats to be calculated here of column 2 (UX-epoch)
stats ifname using 2 name "X" nooutput

X_min = X_min + utc_offset - 946684800
X_max = X_max + utc_offset - 946684800

# ****************************************************************** Title *****
set title "CPU Load"

# ***************************************************************** X-axis *****
set xlabel "Date/Time"       # X-axis label
set xdata time               # Define that data on X-axis should be interpreted as time
set timefmt "%s"             # Time in log-file is given in Unix format
set format x "%R"            # Display time in 24 hour notation on the X axis
set xtics rotate by 40 right
set xrange [ X_min : X_max ]

# ***************************************************************** Y-axis *****
set ylabel "Usage [%]"
set yrange [0:100]
# set autoscale y

# **************************************************************** Y2-axis *****
set y2label "Load"
set autoscale y2
set y2tics border

# ***************************************************************** Legend *****
set key outside bottom center horizontal box
set key samplen .2
set key reverse Left

# ***************************************************************** Output *****
# set arrow from graph 0,graph 0 to graph 0,graph 1 nohead lc rgb "red" front
# set arrow from graph 1,graph 0 to graph 1,graph 1 nohead lc rgb "green" front
set object 1 rect from screen 0,0 to screen 1,1 behind
set object 1 rect fc rgb "#eeeeee" fillstyle solid 1.0 noborder
set object 2 rect from graph 0,0 to graph 1,1 behind
set object 2 rect fc rgb "#ffffff" fillstyle solid 1.0 noborder
set output ofname

# ***** PLOT *****
set style data boxes
set style fill solid noborder
plot ifname \
       using ($2+utc_offset):($10+$11+$12+$13) title "idle"    fc "#229922" \
  , '' using ($2+utc_offset):($10+$11+$13)     title "waiting" fc "blue"    \
  , '' using ($2+utc_offset):($10+$11)         title "system"  fc "yellow"  \
  , '' using ($2+utc_offset):10                title "user"    fc "red"     \
  , '' using ($2+utc_offset):5                 title "load 5min" with lines lw 0.1 lc "black" axes x1y2

#!/usr/bin/env gnuplot

# graph of CPU load

# datafile
ifname = "/tmp/sql12.csv"
ofname = "/tmp/lnxdiagd/site/img/day12.png"

# ******************************************************* General settings *****
# set terminal png font "Vera" 11 size 640,480
set terminal png font "Vera" 10 size 640,304
set datafile separator ';'
set datafile missing "NaN"    # Ignore missing values
set grid front
tz_offset = utc_offset / 3600 # GNUplot only works with UTC. Need to compensate
                              # for timezone ourselves.
set timestamp 'created: %Y-%m-%d %H:%M' bottom

# ************************************************************* Statistics *****
# stats to be calculated here of column 2 (UX-epoch)
stats ifname using 2 name "X" nooutput

X_min = X_min + utc_offset - 946684800
X_max = X_max + utc_offset - 946684800

# ****************************************************************** Title *****
set title "CPU Load"

# ***************************************************************** X-axis *****
set xlabel "Date/Time"       # X-axis label
set xdata time               # Define that data on X-axis should be interpreted as time
set timefmt "%s"             # Time in log-file is given in Unix format
set format x "%R"            # Display time in 24 hour notation on the X axis
set xtics rotate by 40 right
set xrange [ X_min : X_max ]

# ***************************************************************** Y-axis *****
set ylabel "Usage [%]"
set yrange [0:100]
# set autoscale y

# **************************************************************** Y2-axis *****
set y2label "Load"
set autoscale y2
set y2tics border

# ***************************************************************** Legend *****
set key outside bottom center horizontal box
set key samplen .2
set key reverse Left

# ***************************************************************** Output *****
# set arrow from graph 0,graph 0 to graph 0,graph 1 nohead lc rgb "red" front
# set arrow from graph 1,graph 0 to graph 1,graph 1 nohead lc rgb "green" front
set object 1 rect from screen 0,0 to screen 1,1 behind
set object 1 rect fc rgb "#eeeeee" fillstyle solid 1.0 noborder
set object 2 rect from graph 0,0 to graph 1,1 behind
set object 2 rect fc rgb "#ffffff" fillstyle solid 1.0 noborder
set output ofname

# ***** PLOT *****
set style data boxes
set style fill solid noborder
plot ifname \
       using ($2+utc_offset):($10+$11+$12+$13) title "idle"    fc "#229922" \
  , '' using ($2+utc_offset):($10+$11+$13)     title "waiting" fc "blue"    \
  , '' using ($2+utc_offset):($10+$11)         title "system"  fc "yellow"  \
  , '' using ($2+utc_offset):10                title "user"    fc "red"     \
  , '' using ($2+utc_offset):5                 title "load 5min" with dots lc "black" axes x1y2


20160110T1600

#!/usr/bin/gnuplot

# graph of TMP36

tz_offset = utc_offset / 3600 # GNUplot only works with UTC. Need to compensate
                              # for timezone ourselves.

# ************************************************************* Statistics *****
# stats to be calculated here
fname = "/tmp/sql21.csv"
stats fname using 2 name "T2" nooutput

# ******************************************************* General settings *****
set datafile separator ';'
set datafile missing "NaN"   # Ignore missing values
set grid

# ****************************************************************** Title *****
set title "Test graph -".utc_offset."-"

# ***************************************************************** X-axis *****
set xlabel "Date/Time"       # X-axis label
set xdata time               # Define that data on X-axis should be interpreted as time
set timefmt "%s"             # Time in log-file is given in Unix format
set format x "%R"            # Display time in 24 hour notation on the X axis
set xtics rotate by 45 right
set xrange [T2_min+utc_offset:T2_max+utc_offset]

# ***************************************************************** Y-axis *****
set ylabel "Temperature [degC]" # Title for Y-axis
#set yrange [10:20]
set autoscale y

# **************************************************************** Y2-axis *****
#set y2label "Raw values [mV]" # Title for Y2-axis
#set autoscale y2
#set y2tics border         # place ticks on second Y2-axis

# ***************************************************************** Legend *****
# generate a legend which is placed underneath the plot
set key outside bottom center box title "-=legend=-"

# ***************************************************************** Output *****
set terminal png large
set output "/tmp/bonediagd/plot.png"

# Data columns are:
# 2 is Unix Epoch time
# 3 is TMP36 mV
# 4 is calculated temperature

# ***** PLOT *****
plot fname    using ($2+utc_offset):4 title "Temperature [degC]"      with points pointtype 5\
    ,"/tmp/sql21b.csv"   using ($2+utc_offset):3 title "Room temperature [degC]" with points pointtype 5\

#!/usr/bin/gnuplot

# graph of TMP36

# ************************************************************* Statistics *****
# stats to be calculated here

# ******************************************************* General settings *****
set datafile separator ';'
set datafile missing "NaN"   # Ignore missing values
set grid

# ****************************************************************** Title *****
set title "Test graph -".utc_offset."-"

tz_offset = utc_offset / 3600 # GNUplot only works with UTC. Need to compensate
                              # for timezone ourselves.

# ***************************************************************** X-axis *****
set xlabel "Date/Time"       # X-axis label
set xdata time               # Define that data on X-axis should be interpreted as time
set timefmt "%s"             # Time in log-file is given in Unix format
set format x "%R"            # Display time in 24 hour notation on the X axis
set xtics rotate by 45 right

# ***************************************************************** Y-axis *****
set ylabel "Temperature [degC]" # Title for Y-axis
#set yrange [10:20]
set autoscale y

# **************************************************************** Y2-axis *****
#set y2label "Raw values [mV]" # Title for Y2-axis
#set autoscale y2
#set y2tics border         # place ticks on second Y2-axis

# ***************************************************************** Legend *****
# generate a legend which is placed underneath the plot
set key outside bottom center box title "-=legend=-"

# ***************************************************************** Output *****
set terminal png large
set output "/tmp/bonediagd/plot.png"

# Data columns are:
# 2 is Unix Epoch time
# 3 is TMP36 mV
# 4 is calculated temperature

# ***** PLOT *****
plot "/tmp/sql21.csv"    using ($2+utc_offset):4 title "Temperature [degC]"      with points pointtype 5\
    ,"/tmp/sql21b.csv"   using ($2+utc_offset):3 title "Room temperature [degC]" with points pointtype 5\


Fixed upper bound shown for the largest bin of the "binned problem size" diagram.

MPARM = 1
NPARM = 2
KPARM = 3
CPARM = 4
SSIZE = 5
USIZE = 6
FLOPS = 8
MEMBW = 9

HIM = -1
HIN = HIM
HIK = HIM

BASENAME = "cp2k"
FILENAME = system("sh -c \"echo ${FILENAME}\"")
if (FILENAME eq "") {
  FILENAME = BASENAME."-perf.pdf"
}

FILECOUNT = 1 # initial file number
# MULTI =-1: multiple files; no titles
# MULTI = 0: multiple files with titles
# MULTI = 1: single file with titles
MULTI = system("sh -c \"echo ${MULTI}\"")
if (MULTI eq "") {
  MULTI = 1
}

XFLOPS(M, N, K) = 2.0 * M * N * K
NFLOPS(M, N, K) = XFLOPS(column(M), column(N), column(K))
NBYTES(M, N, K, ELEMSIZE) = ELEMSIZE * (column(M) * column(K) + column(K) * column(N) + column(M) * column(N))
AI(M, N, K, ELEMSIZE) = NFLOPS(M, N, K) / NBYTES(M, N, K, ELEMSIZE)

TIME(M, N, K, F, S) = column(S) * NFLOPS(M, N, K) * 1E-9 / column(F)
#BW(M, N, K, F, S, BWC, ELEMSIZE) = column(S) * (column(M) * column(K) + column(K) * column(N)) * ELEMSIZE / (TIME(M, N, K, F, S) * 1024 * 1024 * 1024)
BW(M, N, K, F, S, BWC, ELEMSIZE) = column(BWC)

stats BASENAME."-perf.dat" using (column(MPARM)*column(NPARM)*column(KPARM)) nooutput; MNK = STATS_stddev**(1.0/3.0); MAXMNK = int(STATS_max)
stats BASENAME."-perf.dat" using (log(column(FLOPS))) nooutput; GEO = exp(STATS_sum/STATS_records)
stats BASENAME."-perf.dat" using FLOPS nooutput; MED = STATS_median; MINFLOPS = STATS_min; MAXFLOPS = STATS_max
stats BASENAME."-perf.dat" using NPARM nooutput; XN = int(STATS_max)

MAX(A, B) = A < B ? B : A
ACC = sprintf("%%.%if", ceil(MAX(1.0 / log10(MED) - 1.0, 0)))

IX(I1, J1, NJ) = int(MAX(I1 - 1, 0) * NJ + MAX(J1 - 1, 0))
I1(IX, NJ) = int(IX / NJ) + 1
J1(IX, NJ) = int(IX) % NJ + 1

set table BASENAME."-perf-avg.dat"
plot BASENAME."-perf.dat" using (IX(column(MPARM), column(NPARM), XN)):FLOPS smooth unique
unset table
set table BASENAME."-perf-mbw.dat"
plot BASENAME."-perf.dat" using (BW(MPARM,NPARM,KPARM,FLOPS,SSIZE,MEMBW,8)):(1.0) smooth cumulative
unset table
set table BASENAME."-perf-cdf.dat"
plot BASENAME."-perf.dat" using FLOPS:(1.0) smooth cumulative
unset table
stats BASENAME."-perf-cdf.dat" using (("".strcol(3)."" eq "i")?($2):(1/0)) nooutput; FREQSUM = STATS_max; FREQN = STATS_records

if (MULTI==1) {
  set output FILENAME
}

FILEEXT = system("sh -c \"echo ".FILENAME." | sed 's/.\\+\\.\\(.\\+\\)/\\1/'\"")
set terminal FILEEXT
set termoption enhanced
#set termoption font ",12"
save_encoding = GPVAL_ENCODING
set encoding utf8

reset
if (MULTI<=0) { set output "".FILECOUNT."-".FILENAME; FILECOUNT = FILECOUNT + 1 }
if (MULTI>-1) { set title "Performance" }
set origin -0.03, 0
set pm3d interpolate 0, 0
#set colorbox horizontal user origin 0, 0.1 size 1, 0.1
#set autoscale fix
if (0<HIM) { set xrange [*:HIM] }
if (0<HIN) { set yrange [*:HIN] }
if (0<HIK) { set zrange [*:HIK] }
if (0>HIM) { set xrange [*:MNK] }
if (0>HIN) { set yrange [*:MNK] }
if (0>HIK) { set zrange [*:MNK] }
set xlabel "M"
set ylabel "N" offset -3.0
set zlabel "K" offset 1.0
set ticslevel 0
set cblabel "GFLOP/s" offset 1.5
set format x "%g"; set format y "%g"; set format z "%g"; set format cb "%g"
splot BASENAME."-perf.dat" using MPARM:NPARM:KPARM:FLOPS notitle with points pointtype 7 linetype palette

reset
if (MULTI<=0) { set output "".FILECOUNT."-".FILENAME; FILECOUNT = FILECOUNT + 1 }
if (MULTI>-1) { set title "Performance (K-Average)" }
set origin -0.02, 0
set dgrid3d #9, 9
set pm3d interpolate 0, 0 map
set autoscale fix
set xlabel "M"
set ylabel "N" offset -1.5
set cblabel "GFLOP/s" offset 0.5
set format x "%g"; set format y "%g"; set format cb "%g"
set mxtics 2
splot BASENAME."-perf-avg.dat" using (("".strcol(3)."" eq "i")?(I1($1, XN)):(1/0)):(("".strcol(3)."" eq "i")?(J1($1, XN)):(1/0)):2 notitle with pm3d

reset
if (MULTI<=0) { set output "".FILECOUNT."-".FILENAME; FILECOUNT = FILECOUNT + 1 }
if (MULTI>-1) { set title "Performance (Average per Bin)" }
set style fill solid 0.4 noborder
set boxwidth 0.5
set grid y2tics linecolor "grey"
unset key
unset xtics
set xtics ("MNK <= 13^3" 0, "13^3 < MNK <= 23^3" 1, "23^3 <= MNK" 2) scale 0 offset 0, 0.2
set x2tics ("Small" 0, "Medium" 1, "Larger" 2) scale 0
set xlabel "Problem Size (MNK)"
set ytics format ""
set y2tics nomirror
set y2label "GFLOP/s"
set xrange [-0.5:2.5]
set yrange [0:*]
set autoscale fix
plot  BASENAME."-perf.dat" \
      using (0.0):((NFLOPS(MPARM,NPARM,KPARM)<=XFLOPS(13,13,13))?column(FLOPS):1/0) notitle smooth unique with boxes linetype 1 linecolor "grey", \
  ""  using (1.0):(((XFLOPS(13,13,13)<NFLOPS(MPARM,NPARM,KPARM))&&(NFLOPS(MPARM,NPARM,KPARM)<=XFLOPS(23,23,23)))?column(FLOPS):1/0) notitle smooth unique with boxes linetype 1 linecolor "grey", \
  ""  using (2.0):((XFLOPS(23,23,23)<NFLOPS(MPARM,NPARM,KPARM))?column(FLOPS):1/0) notitle smooth unique with boxes linetype 1 linecolor "grey"

reset
if (MULTI<=0) { set output "".FILECOUNT."-".FILENAME; FILECOUNT = FILECOUNT + 1 }
if (MULTI>-1) { set title "Performance Distribution (CDF)" }
set xlabel "Probability\n\n{/=9 Minimum: ".sprintf(ACC, MINFLOPS)." GFLOP/s  Geo. Mean: ".sprintf(ACC, GEO)." GFLOP/s  Median: ".sprintf(ACC, MED)." GFLOP/s  Maximum: ".sprintf(ACC, MAXFLOPS)." GFLOP/s}"
set ylabel "GB/s"
set y2label "GFLOP/s"
set format x "%g%%"
set format y "%g"
set format y2 "%g"
set ytics nomirror
set y2tics nomirror
set grid x y2 linecolor "grey"
set xrange [0:100]
set yrange [0:*]
set y2range [0:*]
set fit quiet
f(x) = b * x + a
fit f(x) BASENAME."-perf-cdf.dat" using (("".strcol(3)."" eq "i")?(100*$2/FREQSUM):(1/0)):1 via a, b
g(x) = (x - a) / b
x50 = 0.5 * (100 + MAX(0, g(0)))
h(x) = d * x + c
dx = 100 / FREQN
fit [x50-1.5*dx:x50+1.5*dx] h(x) BASENAME."-perf-cdf.dat" using (("".strcol(3)."" eq "i")?(100*$2/FREQSUM):(1/0)):1 via c, d
set arrow from x50, second h(x50) to x50, second 0 front
set arrow from x50, second h(x50) to 100, second h(x50) front
set label sprintf("%.0f%%", x50) at x50, second 0.5 * h(x50) left offset 1 front
set label sprintf(ACC." GFLOP/s", h(x50)) at 0.5 * (x50 + 100.0), second h(x50) centre offset 0, -1 front
set key left invert
plot  BASENAME."-perf-mbw.dat" using (("".strcol(3)."" eq "i")?(100*$2/FREQSUM):(1/0)):1 axes x1y1 title "Memory Bandwidth" with lines linecolor "grey", \
      BASENAME."-perf-cdf.dat" using (("".strcol(3)."" eq "i")?(100*$2/FREQSUM):(1/0)):1 axes x1y2 title "Compute Performance" with lines linewidth 2

reset
if (MULTI<=0) { set output "".FILECOUNT."-".FILENAME; FILECOUNT = FILECOUNT + 1 }
if (MULTI>-1) { set title "Arithmetic Intensity" }
set grid x y2 linecolor "grey"
set key left #spacing 0.5
set ytics format ""
set y2tics nomirror
set y2label "GFLOP/s"
set xlabel "FLOPS/Byte"
set yrange [0:*]
set autoscale fix
plot  BASENAME."-perf.dat" using (AI(MPARM,NPARM,KPARM,8)):FLOPS notitle smooth sbezier with lines linecolor "grey", \
                        "" using (AI(MPARM,NPARM,KPARM,8)):FLOPS notitle smooth unique with points pointtype 7 pointsize 0.2

reset
if (MULTI<=0) { set output "".FILECOUNT."-".FILENAME; FILECOUNT = FILECOUNT + 1 }
if (MULTI>-1) { set title "Memory Bandwidth Consumption" }
set grid x y2 linecolor "grey"
set key left #spacing 0.5
set ytics format ""
set y2tics nomirror
set y2label "GB/s"
set xlabel "Problem Size (MNK^{1/3})"
set yrange [0:*]
set autoscale fix
plot  BASENAME."-perf.dat" using ((column(MPARM)*column(NPARM)*column(KPARM))**(1.0/3.0)):(BW(MPARM,NPARM,KPARM,FLOPS,SSIZE,MEMBW,8)) notitle smooth sbezier with lines linecolor "grey", \
                        "" using ((column(MPARM)*column(NPARM)*column(KPARM))**(1.0/3.0)):(BW(MPARM,NPARM,KPARM,FLOPS,SSIZE,MEMBW,8)) notitle smooth unique with points pointtype 7 pointsize 0.2

MPARM = 1
NPARM = 2
KPARM = 3
CPARM = 4
SSIZE = 5
USIZE = 6
FLOPS = 8
MEMBW = 9

HIM = -1
HIN = HIM
HIK = HIM

BASENAME = "cp2k"
FILENAME = system("sh -c \"echo ${FILENAME}\"")
if (FILENAME eq "") {
  FILENAME = BASENAME."-perf.pdf"
}

FILECOUNT = 1 # initial file number
# MULTI =-1: multiple files; no titles
# MULTI = 0: multiple files with titles
# MULTI = 1: single file with titles
MULTI = system("sh -c \"echo ${MULTI}\"")
if (MULTI eq "") {
  MULTI = 1
}

XFLOPS(M, N, K) = 2.0 * M * N * K
NFLOPS(M, N, K) = XFLOPS(column(M), column(N), column(K))
NBYTES(M, N, K, ELEMSIZE) = ELEMSIZE * (column(M) * column(K) + column(K) * column(N) + column(M) * column(N))
AI(M, N, K, ELEMSIZE) = NFLOPS(M, N, K) / NBYTES(M, N, K, ELEMSIZE)

TIME(M, N, K, F, S) = column(S) * NFLOPS(M, N, K) * 1E-9 / column(F)
#BW(M, N, K, F, S, BWC, ELEMSIZE) = column(S) * (column(M) * column(K) + column(K) * column(N)) * ELEMSIZE / (TIME(M, N, K, F, S) * 1024 * 1024 * 1024)
BW(M, N, K, F, S, BWC, ELEMSIZE) = column(BWC)

stats BASENAME."-perf.dat" using (column(MPARM)*column(NPARM)*column(KPARM)) nooutput; MNK = STATS_stddev**(1.0/3.0); MAXMNK = int(STATS_max)
stats BASENAME."-perf.dat" using (log(column(FLOPS))) nooutput; GEO = exp(STATS_sum/STATS_records)
stats BASENAME."-perf.dat" using FLOPS nooutput; MED = STATS_median; MINFLOPS = STATS_min; MAXFLOPS = STATS_max
stats BASENAME."-perf.dat" using NPARM nooutput; XN = int(STATS_max)

MAX(A, B) = A < B ? B : A
ACC = sprintf("%%.%if", ceil(MAX(1.0 / log10(MED) - 1.0, 0)))

IX(I1, J1, NJ) = int(MAX(I1 - 1, 0) * NJ + MAX(J1 - 1, 0))
I1(IX, NJ) = int(IX / NJ) + 1
J1(IX, NJ) = int(IX) % NJ + 1

set table BASENAME."-perf-avg.dat"
plot BASENAME."-perf.dat" using (IX(column(MPARM), column(NPARM), XN)):FLOPS smooth unique
unset table
set table BASENAME."-perf-mbw.dat"
plot BASENAME."-perf.dat" using (BW(MPARM,NPARM,KPARM,FLOPS,SSIZE,MEMBW,8)):(1.0) smooth cumulative
unset table
set table BASENAME."-perf-cdf.dat"
plot BASENAME."-perf.dat" using FLOPS:(1.0) smooth cumulative
unset table
stats BASENAME."-perf-cdf.dat" using (("".strcol(3)."" eq "i")?($2):(1/0)) nooutput; FREQSUM = STATS_max; FREQN = STATS_records

if (MULTI==1) {
  set output FILENAME
}

FILEEXT = system("sh -c \"echo ".FILENAME." | sed 's/.\\+\\.\\(.\\+\\)/\\1/'\"")
set terminal FILEEXT
set termoption enhanced
#set termoption font ",12"
save_encoding = GPVAL_ENCODING
set encoding utf8

reset
if (MULTI<=0) { set output "".FILECOUNT."-".FILENAME; FILECOUNT = FILECOUNT + 1 }
if (MULTI>-1) { set title "Performance" }
set origin -0.03, 0
set pm3d interpolate 0, 0
#set colorbox horizontal user origin 0, 0.1 size 1, 0.1
#set autoscale fix
if (0<HIM) { set xrange [*:HIM] }
if (0<HIN) { set yrange [*:HIN] }
if (0<HIK) { set zrange [*:HIK] }
if (0>HIM) { set xrange [*:MNK] }
if (0>HIN) { set yrange [*:MNK] }
if (0>HIK) { set zrange [*:MNK] }
set xlabel "M"
set ylabel "N" offset -3.0
set zlabel "K" offset 1.0
set ticslevel 0
set cblabel "GFLOP/s" offset 1.5
set format x "%g"; set format y "%g"; set format z "%g"; set format cb "%g"
splot BASENAME."-perf.dat" using MPARM:NPARM:KPARM:FLOPS notitle with points pointtype 7 linetype palette

reset
if (MULTI<=0) { set output "".FILECOUNT."-".FILENAME; FILECOUNT = FILECOUNT + 1 }
if (MULTI>-1) { set title "Performance (K-Average)" }
set origin -0.02, 0
set dgrid3d #9, 9
set pm3d interpolate 0, 0 map
set autoscale fix
set xlabel "M"
set ylabel "N" offset -1.5
set cblabel "GFLOP/s" offset 0.5
set format x "%g"; set format y "%g"; set format cb "%g"
set mxtics 2
splot BASENAME."-perf-avg.dat" using (("".strcol(3)."" eq "i")?(I1($1, XN)):(1/0)):(("".strcol(3)."" eq "i")?(J1($1, XN)):(1/0)):2 notitle with pm3d

reset
if (MULTI<=0) { set output "".FILECOUNT."-".FILENAME; FILECOUNT = FILECOUNT + 1 }
if (MULTI>-1) { set title "Performance (Average per Bin)" }
set style fill solid 0.4 noborder
set boxwidth 0.5
set grid y2tics linecolor "grey"
unset key
unset xtics
set xtics ("MNK <= 13^3" 0, "13^3 < MNK <= 23^3" 1, "23^3 < MNK" 2) scale 0 offset 0, 0.2
set x2tics ("Small" 0, "Medium" 1, "Larger" 2) scale 0
set xlabel "Problem Size (MNK)"
set ytics format ""
set y2tics nomirror
set y2label "GFLOP/s"
set xrange [-0.5:2.5]
set yrange [0:*]
set autoscale fix
plot  BASENAME."-perf.dat" \
      using (0.0):((NFLOPS(MPARM,NPARM,KPARM)<=XFLOPS(13,13,13))?column(FLOPS):1/0) notitle smooth unique with boxes linetype 1 linecolor "grey", \
  ""  using (1.0):(((XFLOPS(13,13,13)<NFLOPS(MPARM,NPARM,KPARM))&&(NFLOPS(MPARM,NPARM,KPARM)<=XFLOPS(23,23,23)))?column(FLOPS):1/0) notitle smooth unique with boxes linetype 1 linecolor "grey", \
  ""  using (2.0):((XFLOPS(23,23,23)<NFLOPS(MPARM,NPARM,KPARM))?column(FLOPS):1/0) notitle smooth unique with boxes linetype 1 linecolor "grey"

reset
if (MULTI<=0) { set output "".FILECOUNT."-".FILENAME; FILECOUNT = FILECOUNT + 1 }
if (MULTI>-1) { set title "Performance Distribution (CDF)" }
set xlabel "Probability\n\n{/=9 Minimum: ".sprintf(ACC, MINFLOPS)." GFLOP/s  Geo. Mean: ".sprintf(ACC, GEO)." GFLOP/s  Median: ".sprintf(ACC, MED)." GFLOP/s  Maximum: ".sprintf(ACC, MAXFLOPS)." GFLOP/s}"
set ylabel "GB/s"
set y2label "GFLOP/s"
set format x "%g%%"
set format y "%g"
set format y2 "%g"
set ytics nomirror
set y2tics nomirror
set grid x y2 linecolor "grey"
set xrange [0:100]
set yrange [0:*]
set y2range [0:*]
set fit quiet
f(x) = b * x + a
fit f(x) BASENAME."-perf-cdf.dat" using (("".strcol(3)."" eq "i")?(100*$2/FREQSUM):(1/0)):1 via a, b
g(x) = (x - a) / b
x50 = 0.5 * (100 + MAX(0, g(0)))
h(x) = d * x + c
dx = 100 / FREQN
fit [x50-1.5*dx:x50+1.5*dx] h(x) BASENAME."-perf-cdf.dat" using (("".strcol(3)."" eq "i")?(100*$2/FREQSUM):(1/0)):1 via c, d
set arrow from x50, second h(x50) to x50, second 0 front
set arrow from x50, second h(x50) to 100, second h(x50) front
set label sprintf("%.0f%%", x50) at x50, second 0.5 * h(x50) left offset 1 front
set label sprintf(ACC." GFLOP/s", h(x50)) at 0.5 * (x50 + 100.0), second h(x50) centre offset 0, -1 front
set key left invert
plot  BASENAME."-perf-mbw.dat" using (("".strcol(3)."" eq "i")?(100*$2/FREQSUM):(1/0)):1 axes x1y1 title "Memory Bandwidth" with lines linecolor "grey", \
      BASENAME."-perf-cdf.dat" using (("".strcol(3)."" eq "i")?(100*$2/FREQSUM):(1/0)):1 axes x1y2 title "Compute Performance" with lines linewidth 2

reset
if (MULTI<=0) { set output "".FILECOUNT."-".FILENAME; FILECOUNT = FILECOUNT + 1 }
if (MULTI>-1) { set title "Arithmetic Intensity" }
set grid x y2 linecolor "grey"
set key left #spacing 0.5
set ytics format ""
set y2tics nomirror
set y2label "GFLOP/s"
set xlabel "FLOPS/Byte"
set yrange [0:*]
set autoscale fix
plot  BASENAME."-perf.dat" using (AI(MPARM,NPARM,KPARM,8)):FLOPS notitle smooth sbezier with lines linecolor "grey", \
                        "" using (AI(MPARM,NPARM,KPARM,8)):FLOPS notitle smooth unique with points pointtype 7 pointsize 0.2

reset
if (MULTI<=0) { set output "".FILECOUNT."-".FILENAME; FILECOUNT = FILECOUNT + 1 }
if (MULTI>-1) { set title "Memory Bandwidth Consumption" }
set grid x y2 linecolor "grey"
set key left #spacing 0.5
set ytics format ""
set y2tics nomirror
set y2label "GB/s"
set xlabel "Problem Size (MNK^{1/3})"
set yrange [0:*]
set autoscale fix
plot  BASENAME."-perf.dat" using ((column(MPARM)*column(NPARM)*column(KPARM))**(1.0/3.0)):(BW(MPARM,NPARM,KPARM,FLOPS,SSIZE,MEMBW,8)) notitle smooth sbezier with lines linecolor "grey", \
                        "" using ((column(MPARM)*column(NPARM)*column(KPARM))**(1.0/3.0)):(BW(MPARM,NPARM,KPARM,FLOPS,SSIZE,MEMBW,8)) notitle smooth unique with points pointtype 7 pointsize 0.2


updated file to plot multiple graphs

updated file to plot multiple graphs

set xdata time
set timefmt "%Y-%m-%d"
set terminal png
set xzeroaxis lt -1

set output "membersdelta.png"
plot "membersdelta.dat" using 1:2

set output "memberscummulative.png"
plot "memberscummulative.dat" using 1:2 with steps

set xdata time
set timefmt "%Y-%m-%d"
set terminal png
set output "membersdelta.png"
plot "membersdelta.dat" using 1:2 with boxes
set output "memberscummulative.png"
plot "memberscummulative.dat" using 1:2 with boxes