about [rrdtool-1.x] Fetch callback (#502)

Peter Childs <[email protected]> Fri, 13 Jun 2014 09:41:10 +0000
Newsgroups gmane.comp.db.rrdtool.devel
Message-ID <CFC0FD4C.98A60%[email protected]>
--===============1278853833==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_CFC0FD4C98A60pchildsstaffiinetnetau_"

--_000_CFC0FD4C98A60pchildsstaffiinetnetau_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable


Reading the comments, and the edit to src/rrd_graph.c

   968 +        // remember that we already got this one
   969 +        g_hash_table_insert(im->rrd_map,gdes_fetch_key(im->gdes[i])=
,GINT_TO_POINTER(i));

I have noted when I tried to build a custom backend using rrdcached protoco=
l that when drawing a graph it appeared to a little inefficient.

For example
  If I had a RRD with DS(s) of inOct, outOct, inErrs, outErrs and then used=
 'graph' to generate a single graph with all those DS's from the same RRD I=
 would see 4 FETCH operations via rrdcached.

Since the fetch does not specify the DS required, all the datasources in th=
e RRD need to be returned.   This probably isn't a problem for simple RRD f=
iles, but for example if you have 12 metrics, and each metric has a 'cost' =
to 'get', and you only really need two for your graph, you need to fetch th=
em all anyway (or in my example, you need to fetch them all, then remangle =
them into the appropriate structures, then return them ..)

My question is -- does this change to the rrd_graph data_fetch() mean that =
I will not see multiple fetch operations ?

(I guess I should just go and test it ...)

:)


--_000_CFC0FD4C98A60pchildsstaffiinetnetau_
Content-Type: text/html; charset="us-ascii"
Content-ID: <[email protected]>
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
</head>
<body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-lin=
e-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-fami=
ly: Calibri, sans-serif; ">
<div>
<div>
<div>
<div style=3D"color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-s=
ize: 14px; ">
<br>
</div>
<div style=3D"color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-s=
ize: 14px; ">
Reading the comments, and the edit to src/rrd_graph.c</div>
<div style=3D"color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-s=
ize: 14px; ">
<br>
</div>
<div>
<div><font class=3D"Apple-style-span" face=3D"Calibri,sans-serif">&nbsp;&nb=
sp;<span class=3D"Apple-tab-span" style=3D"white-space: pre; ">
</span>968&nbsp;<span class=3D"Apple-tab-span" style=3D"white-space: pre; "=
></span></font><span class=3D"Apple-style-span" style=3D"font-family: Calib=
ri, sans-serif; ">&#43; &nbsp; &nbsp; &nbsp; &nbsp;// remember that we alre=
ady got this one</span></div>
<div><span class=3D"Apple-style-span" style=3D"font-family: Calibri, sans-s=
erif; ">&nbsp;&nbsp;</span><span class=3D"Apple-style-span" style=3D"font-f=
amily: Calibri, sans-serif; "><span class=3D"Apple-tab-span" style=3D"white=
-space: pre; ">
</span></span><span class=3D"Apple-style-span" style=3D"font-family: Calibr=
i, sans-serif; ">969&nbsp;</span><span class=3D"Apple-style-span" style=3D"=
font-family: Calibri, sans-serif; "><span class=3D"Apple-tab-span" style=3D=
"white-space: pre; "></span></span><span class=3D"Apple-style-span" style=
=3D"font-family: Calibri, sans-serif; ">&#43;
 &nbsp; &nbsp; &nbsp; &nbsp;g_hash_table_insert(im-&gt;rrd_map,gdes_fetch_k=
ey(im-&gt;gdes[i]),GINT_TO_POINTER(i));</span></div>
</div>
<div><span class=3D"Apple-style-span" style=3D"font-family: Calibri, sans-s=
erif; "><br>
</span></div>
<div><span class=3D"Apple-style-span" style=3D"font-family: Calibri, sans-s=
erif; ">I have noted when I tried to build a custom backend using rrdcached=
 protocol that when drawing a graph it appeared to a little inefficient.</s=
pan></div>
<div><span class=3D"Apple-style-span" style=3D"font-family: Calibri, sans-s=
erif; "><br>
</span></div>
<div><span class=3D"Apple-style-span" style=3D"font-family: Calibri, sans-s=
erif; ">For example</span></div>
<div><span class=3D"Apple-style-span" style=3D"font-family: Calibri, sans-s=
erif; ">&nbsp; If I had a RRD with DS(s) of inOct, outOct, inErrs, outErrs =
and then used 'graph' to generate a single graph with all those DS's from t=
he same RRD I would see 4 FETCH operations
 via rrdcached.</span></div>
<div><span class=3D"Apple-style-span" style=3D"font-family: Calibri, sans-s=
erif; "><br>
</span></div>
<div><span class=3D"Apple-style-span" style=3D"font-family: Calibri, sans-s=
erif; ">Since the fetch does not specify the DS required, all the datasourc=
es in the RRD need to be returned. &nbsp; This probably isn't a problem for=
 simple RRD files, but for example if you
 have 12 metrics, and each metric has a 'cost' to 'get', and you only reall=
y need two for your graph, you need to fetch them all anyway (or in my exam=
ple, you need to fetch them all, then remangle them into the appropriate st=
ructures, then return them ..)</span></div>
<div><span class=3D"Apple-style-span" style=3D"font-family: Calibri, sans-s=
erif; "><br>
</span></div>
<div><span class=3D"Apple-style-span" style=3D"font-family: Calibri, sans-s=
erif; ">My question is -- does this change to the rrd_graph data_fetch() me=
an that I will not see multiple fetch operations ?</span></div>
<div><span class=3D"Apple-style-span" style=3D"font-family: Calibri, sans-s=
erif; "><br>
</span></div>
<div><span class=3D"Apple-style-span" style=3D"font-family: Calibri, sans-s=
erif; ">(I guess I should just go and test it ...)</span></div>
<div><span class=3D"Apple-style-span" style=3D"font-family: Calibri, sans-s=
erif; "><br>
</span></div>
<div><span class=3D"Apple-style-span" style=3D"font-family: Calibri, sans-s=
erif; ">:)</span></div>
<div><span class=3D"Apple-style-span" style=3D"font-family: Calibri, sans-s=
erif; "><br>
</span></div>
</div>
</div>
</div>
</body>
</html>

--_000_CFC0FD4C98A60pchildsstaffiinetnetau_--


--===============1278853833==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
rrd-developers mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers

--===============1278853833==--