Sorry for being dumb, but I still don't understand what you mean - I suppose the data for billing are stored in mysql, not RRD, the graph looks fine, but the P95 is calculated wrongly - see the output of graph.inc when I set up $debug=1 below.

I have a bill that works, and all others (20 or so, even a fresh one) have P95 calculated wrongly, though the data looks fine. What calculates the data, and from what sources? Where's the mistake?

A working case (bill id=1)

Array ( [0] => bill_bits [type] => bill [1] => bill [subtype] => bits [2] => bits ) SQL[SELECT * FROM `bills` WHERE bill_id = '1'] SQL[] SQL[SELECT delta FROM bill_data WHERE bill_id = '1' AND timestamp > '20130601000000' AND timestamp <= '20130630235959' ORDER BY delta ASC] SQL[SELECT SUM(period) as period, SUM(delta) as total, SUM(in_delta) as inbound, SUM(out_delta) as outbound FROM bill_data WHERE bill_id = '1' AND timestamp > '20130601000000' AND timestamp 
 &
lt;= '20130630235959'] SQL[SELECT count(delta) FROM bill_data WHERE bill_id = '1' AND timestamp > '20130601000000' AND timestamp <= '20130630235959'] SQL[SELECT (in_delta / period * 8) AS rate FROM bill_data WHERE bill_id = '1' AND timestamp > '20130601000000' AND timestamp <= '20130630235959' ORDER BY rate ASC] SQL[SELECT count(delta) FROM bill_data WHERE bill_id = '1' AND timestamp > '20130601000000' AND timestamp <= '20130630235959'] SQL[SELECT (out_delta / period * 8) AS rate FROM bill_data WHERE bill_id = '1' AND timestamp > '20130601000000' AND timestamp <= '20130630235959' ORDER BY rate ASC] SQL[SELECT * FROM `bill_ports` AS B, `ports` AS P, `devices` AS D WHERE B.bill_id = '1' AND P.port_id = B.port_id AND D.device_id = P.device_id] OK u:0.12 s:0.01 r:0.13

graph /tmp/TTSigLGVPFcTsvps.png --alt-autoscale-max --rigid -E --start 1370037600 --end 1372629599 --width 1050 --height 300 -c BACK#EEEEEE00 -c SHADEA#EEEEEE00 -c SHADEB#EEEEEE00 -c FONT#000000 -c CANVAS#FFFFFF00 -c GRID#a5a5a5 -c MGRID#FF9999 -c FRAME#5e5e5e -c ARROW#5e5e5e -R normal --font LEGEND:8:DejaVuSansMono --font AXIS:7:DejaVuSansMono --font-render-mode normal COMMENT:'Bits/sec Current Average Maximum ' COMMENT:'\l' DEF:in0=/opt/observium/rrd/sit-core-01-4900m/port-82.rrd:INOCTETS:AVERAGE DEF:out0=/opt/observium/rrd/sit-core-01-4900m/port-82.rrd:OUTOCTETS:AVERAGE CDEF:inB0=in0,8,* CDEF:outB0=out0,8,* CDEF:outB0_neg=outB0,-1,* CDEF:octets0=inB0,outB0,+ VDEF:totin0=inB0,TOTAL VDEF:totout0=outB0,TOTAL VDEF:tot0=octets0,TOTAL AREA:inB0#B6D14B:'Vlan302 In': GPRINT:inB0:LAST:%6.2lf%sbps GPRINT:inB0:AVERAGE:%6.2lf%sbps GPRINT:inB0:MAX:%6.2lf%sbps 'COMMENT:\n' 'HRULE:0#A0A0E5: Out' GPRINT:outB0:LAST:%6.2lf%sbps GPRINT:outB0:AVERAGE:%6.2lf%sbps GPRINT:outB0:MAX:%6.2lf%sbps 'COMMENT:\n' DEF:in1=/opt/observium/rrd/sit-6509e-gtt/port-362.rrd:INOCTETS:AVERAGE DEF:out1=/opt/observium/rrd/sit-6509e-gtt/port-362.rrd:OUTOCTETS:AVERAGE CDEF:inB1=in1,8,* CDEF:outB1=out1,8,* CDEF:outB1_neg=outB1,-1,* CDEF:octets1=inB1,outB1,+ VDEF:totin1=inB1,TOTAL VDEF:totout1=outB1,TOTAL VDEF:tot1=octets1,TOTAL AREA:inB1#A4C445:'Vlan303 In':STACK GPRINT:inB1:LAST:%6.2lf%sbps GPRINT:inB1:AVERAGE:%6.2lf%sbps GPRINT:inB1:MAX:%6.2lf%sbps 'COMMENT:\n' 'HRULE:0#9090D3: Out' GPRINT:outB1:LAST:%6.2lf%sbps GPRINT:outB1:AVERAGE:%6.2lf%sbps GPRINT:outB1:MAX:%6.2lf%sbps 'COMMENT:\n' CDEF:inoctets=in0,UN,0,in0,IF,in1,UN,0,in1,IF,+ CDEF:outoctets=out0,UN,0,out0,IF,out1,UN,0,out1,IF,+ CDEF:doutoctets=outoctets,-1,* CDEF:inbits=inoctets,8,* CDEF:outbits=outoctets,8,* CDEF:doutbits=doutoctets,8,* VDEF:95thin=inbits,95,PERCENT VDEF:95thout=outbits,95,PERCENT VDEF:d95thout=doutbits,5,PERCENT LINE1.25:inbits#005500:'Total In ' GPRINT:inbits:LAST:%6.2lf%s GPRINT:inbits:AVERAGE:%6.2lf%s GPRINT:inbits:MAX:%6.2lf%s GPRINT:95thin:%6.2lf%s\\n LINE1.25:doutbits#000055:'Total Out ' GPRINT:outbits:LAST:%6.2lf%s GPRINT:outbits:AVERAGE:%6.2lf%s GPRINT:outbits:MAX:%6.2lf%s GPRINT:95thout:%6.2lf%s\\n COMMENT:'\r' HRULE:682468480.99#cc0000:'95th %ile \: 682Mbps (out) (CDR\: 500Mbps)' HRULE:-682468480.99#cc0000 'AREA:outB0_neg#A0A0E5::' 'AREA:outB1_neg#9090D3::STACK' HRULE:0#999999

command returned 0 (1131x467 )


This is a non-working case:

Array ( [0] => bill_bits [type] => bill [1] => bill [subtype] => bits [2] => bits ) SQL[SELECT * FROM `bills` WHERE bill_id = '3'] SQL[] SQL[SELECT delta FROM bill_data WHERE bill_id = '3' AND timestamp > '20130601000000' AND timestamp <= '20130630235959' ORDER BY delta ASC] SQL[SELECT SUM(period) as period, SUM(delta) as total, SUM(in_delta) as inbound, SUM(out_delta) as outbound FROM bill_data WHERE bill_id = '3' AND timestamp > '20130601000000' AND timestamp <= '20130630235959'] SQL[SELECT count(delta) FROM bill_data WHERE bill_id = '3' AND timestamp > '20130601000000' AND timestamp <= '20130630235959'] SQL[SELECT (in_delta / period * 8) AS rate FROM bill_data WHERE bill_id = '3' AND timestamp > '20130601000000' AND timestamp <= '20130630235959' ORDER BY rate ASC] SQL[SELECT count(delta) FROM bill_data WHERE bill_id = '3' AND timestamp > '20130601000000' AND timestamp <= '20130630235959'] SQL[SELECT (out_delta / period * 8) AS rate FROM bill_data WHERE bill_id = '3' AND timestamp > '20130601000000' AND timestamp <= '20130630235959' ORDER BY rate ASC] SQL[SELECT * FROM `bill_ports` AS B, `ports` AS P, `devices` AS D WHERE B.bill_id = '3' AND P.port_id = B.port_id AND D.device_id = P.device_id] OK u:0.14 s:0.00 r:0.14

graph /tmp/25VZxzmiqYwlO6lo.png --alt-autoscale-max --rigid -E --start 1370037600 --end 1372629599 --width 1050 --height 300 -c BACK#EEEEEE00 -c SHADEA#EEEEEE00 -c SHADEB#EEEEEE00 -c FONT#000000 -c CANVAS#FFFFFF00 -c GRID#a5a5a5 -c MGRID#FF9999 -c FRAME#5e5e5e -c ARROW#5e5e5e -R normal --font LEGEND:8:DejaVuSansMono --font AXIS:7:DejaVuSansMono --font-render-mode normal COMMENT:'Bits/sec Current Average Maximum ' COMMENT:'\l' DEF:in0=/opt/observium/rrd/sit-core-01-4900m/port-83.rrd:INOCTETS:AVERAGE DEF:out0=/opt/observium/rrd/sit-core-01-4900m/port-83.rrd:OUTOCTETS:AVERAGE CDEF:inB0=in0,8,* CDEF:outB0=out0,8,* CDEF:outB0_neg=outB0,-1,* CDEF:octets0=inB0,outB0,+ VDEF:totin0=inB0,TOTAL VDEF:totout0=outB0,TOTAL VDEF:tot0=octets0,TOTAL AREA:inB0#B6D14B:'Vlan504 In': GPRINT:inB0:LAST:%6.2lf%sbps GPRINT:inB0:AVERAGE:%6.2lf%sbps GPRINT:inB0:MAX:%6.2lf%sbps 'COMMENT:\n' 'HRULE:0#A0A0E5: Out' GPRINT:outB0:LAST:%6.2lf%sbps GPRINT:outB0:AVERAGE:%6.2lf%sbps GPRINT:outB0:MAX:%6.2lf%sbps 'COMMENT:\n' CDEF:inoctets=in0,UN,0,in0,IF CDEF:outoctets=out0,UN,0,out0,IF CDEF:doutoctets=outoctets,-1,* CDEF:inbits=inoctets,8,* CDEF:outbits=outoctets,8,* CDEF:doutbits=doutoctets,8,* VDEF:95thin=inbits,95,PERCENT VDEF:95thout=outbits,95,PERCENT VDEF:d95thout=doutbits,5,PERCENT LINE1.25:inbits#005500:'Total In ' GPRINT:inbits:LAST:%6.2lf%s GPRINT:inbits:AVERAGE:%6.2lf%s GPRINT:inbits:MAX:%6.2lf%s GPRINT:95thin:%6.2lf%s\\n LINE1.25:doutbits#000055:'Total Out ' GPRINT:outbits:LAST:%6.2lf%s GPRINT:outbits:AVERAGE:%6.2lf%s GPRINT:outbits:MAX:%6.2lf%s GPRINT:95thout:%6.2lf%s\\n COMMENT:'\r' HRULE:63619572.29#cc0000:'95th %ile \: 63.6Mbps (out) (CDR\: 0bps)' HRULE:-63619572.29#cc0000 'AREA:outB0_neg#A0A0E5::' HRULE:0#999999

command returned 0 (1131x439 )



So where's the mistake?



Hynek

On 5.6.2013 11:20, Adam Armstrong wrote:
The RRD graph 95th is generated by RRD. There is nothing we can do to affect it mathematically.

adam.


On 2013-06-05 08:54, Hynek Med wrote:
Well I would gladly supply you my data..

This is what I get when I set $debug=1 in graph.inc.php.

Array ( [0] => bill_bits [type] => bill [1] => bill [subtype] => bits
[2] => bits ) SQL[SELECT * FROM `bills` WHERE bill_id = '22'] SQL[]
SQL[SELECT delta FROM bill_data WHERE bill_id = '22' AND timestamp >
'20130501000000' AND timestamp <= '20130530235959' ORDER BY delta ASC]
SQL[SELECT SUM(period) as period, SUM(delta) as total, SUM(in_delta)
as inbound, SUM(out_delta) as outbound FROM bill_data WHERE bill_id =
'22' AND timestamp > '20130501000000' AND timesta
m
p <= '20130530235959'] SQL[SELECT count(delta) FROM bill_data WHERE
bill_id = '22' AND timestamp > '20130501000000' AND timestamp <=
'20130530235959'] SQL[SELECT (in_delta / period * 8) AS rate FROM
bill_data WHERE bill_id = '22' AND timestamp > '20130501000000' AND
timestamp <= '20130530235959' ORDER BY rate ASC] SQL[SELECT
count(delta) FROM bill_data WHERE bill_id = '22' AND timestamp >
'20130501000000' AND timestamp <= '20130530235959'] SQL[SELECT
(out_delta / period * 8) AS rate FROM bill_data WHERE bill_id = '22'
AND timestamp > '20130501000000' AND timestamp <= '20130530235959'
ORDER BY rate ASC] SQL[SELECT * FROM `bill_ports` AS B, `ports` AS P,
`devices` AS D WHERE B.bill_id = '22' AND P.port_id = B.port_id AND
D.device_id = P.device_id] OK u:0.16 s:0.00 r:0.17

graph /tmp/yhPqSmYU1s6LIbKi.png --alt-autoscale-max --rigid -E --start
1367359200 --end 1369951199 --width 1050 --height 300 -c BACK#EEEEEE00
-c SHADEA#EEEEEE00 -c SHADEB#EEEEEE00 -c FONT#000000 -c
CANVAS#FFFFFF00 -c GRID#a5a5a5 -c MGRID#FF9999 -c FRAME#5e5e5e -c
ARROW#5e5e5e -R normal --font LEGEND:8:DejaVuSansMono --font
AXIS:7:DejaVuSansMono --font-render-mode normal COMMENT:'Bits/sec
Current Average Maximum ' COMMENT:'l'
DEF:in0=/opt/observium/rrd/sit-cre-02-7606s/port-371.rrd:INOCTETS:AVERAGE
DEF:out0=/opt/observium/rrd/sit-cre-02-7606s/port-371.rrd:OUTOCTETS:AVERAGE
CDEF:inB0=in0,8,* CDEF:outB0=out0,8,* CDEF:outB0_neg=outB0,-1,*
CDEF:octets0=inB0,outB0,+ VDEF:totin0=inB0,TOTAL
VDEF:totout0=outB0,TOTAL VDEF:tot0=octets0,TOTAL
AREA:inB0#B6D14B:'Vlan166 In': GPRINT:inB0:LAST:%6.2lf%sbps
GPRINT:inB0:AVERAGE:%6.2lf%sbps GPRINT:inB0:MAX:%6.2lf%sbps
'COMMENT:n' 'HRULE:0#A0A0E5: Out' GPRINT:outB0:LAST:%6.2lf%sbps
GPRINT:outB0:AVERAGE:%6.2lf%sbps GPRINT:outB0:MAX:%6.2lf%sbps
'COMMENT:n'
DEF:in1=/opt/observium/rrd/sit-cre-02-7606s/port-372.rrd:INOCTETS:AVERAGE
DEF:out1=/opt/observium/rrd/sit-cre-02-7606s/port-372.rrd:OUTOCTETS:AVERAGE
CDEF:inB1=in1,8,* CDEF:outB1=out1,8,* CDEF:outB1_neg=outB1,-1,*
CDEF:octets1=inB1,outB1,+ VDEF:totin1=inB1,TOTAL
VDEF:totout1=outB1,TOTAL VDEF:tot1=octets1,TOTAL
AREA:inB1#A4C445:'Vlan161 In':STACK GPRINT:inB1:LAST:%6.2lf%sbps
GPRINT:inB1:AVERAGE:%6.2lf%sbps GPRINT:inB1:MAX:%6.2lf%sbps
'COMMENT:n' 'HRULE:0#9090D3: Out' GPRINT:outB1:LAST:%6.2lf%sbps
GPRINT:outB1:AVERAGE:%6.2lf%sbps GPRINT:outB1:MAX:%6.2lf%sbps
'COMMENT:n' CDEF:inoctets=in0,UN,0,in0,IF,in1,UN,0,in1,IF,+
CDEF:outoctets=out0,UN,0,out0,IF,out1,UN,0,out1,IF,+
CDEF:doutoctets=outoctets,-1,* CDEF:inbits=inoctets,8,*
CDEF:outbits=outoctets,8,* CDEF:doutbits=doutoctets,8,*
VDEF:95thin=inbits,95,PERCENT VDEF:95thout=outbits,95,PERCENT
VDEF:d95thout=doutbits,5,PERCENT LINE1.25:inbits#005500:'Total In '
GPRINT:inbits:LAST:%6.2lf%s GPRINT:inbits:AVERAGE:%6.2lf%s
GPRINT:inbits:MAX:%6.2lf%s GPRINT:95thin:%6.2lf%s\n
LINE1.25:doutbits#000055:'Total Out ' GPRINT:outbits:LAST:%6.2lf%s
GPRINT:outbits:AVERAGE:%6.2lf%s GPRINT:outbits:MAX:%6.2lf%s
GPRINT:95thout:%6.2lf%s\n COMMENT:'r' HRULE:51244383.26#cc0000:'95th
%ile : 51.2Mbps (out)
(CDR: 300Mbps)' HRULE:-51244383.26#cc0000
'AREA:outB0_neg#A0A0E5::' 'AREA:outB1_neg#9090D3::STACK'
HRULE:0#999999

command returned 0 (1131x467 )
Can you at least give me some pointers, where to look at, what file to
compare to a vanilla distribution etc ?

Thanks,

Hynek

On 3.6.2013 18:29, Adam Armstrong wrote:

I can't seem to replicate what you're seeing. My test data is fine.

adam.

On 2013-06-03 17:23, Hynek Med wrote:

but why / how to fix that?

h.

On 3.6.2013 18:00, Adam Armstrong wrote:

Sounds like it's calculating averages.

adam.

On 2013-06-03 16:10, Hynek Med wrote:
Probably somewhere between r3465 to r3981 (yes, I know) billing
started producing wrong results. now at 4102, the situation remains
the same. I do run the discovery script after each update.

Graphs (quick graphs) look fine with real traffic accounted, but the
calculated P95 is unrealistically low (something like 1/3 of the real
P95, but this ratio is different for each case). Both with single VLAN
and multiple VLAN bills. One of the bills (with id=1) works completely
fine though.

Any ideas where to look at / what to compare at the working case with
the non-working case?

Thanks,

Hynek
_______________________________________________
observium mailing list
observium@observium.org
http://postman.memetic.org/cgi-bin/mailman/listinfo/observium [1]
_______________________________________________
observium mailing list
observium@observium.org
http://postman.memetic.org/cgi-bin/mailman/listinfo/observium [1]

--
Hynek Med

PRO-ZETA a.s.
Tiskarska 10/257
108 00 Praha 10
Czech Republic


Links:
------
[1] http://postman.memetic.org/cgi-bin/mailman/listinfo/observium

_______________________________________________
observium mailing list
observium@observium.org
http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
_______________________________________________
observium mailing list
observium@observium.org
http://postman.memetic.org/cgi-bin/mailman/listinfo/observium


-- 
Hynek Med

PRO-ZETA a.s.
Tiskarska 10/257
108 00 Praha 10
Czech Republic