Code

Fix Win32 build. VC++ 6.0 and 7.0 now use the thread-safe code.
[rrdtool.git] / PROJECTS
1 NEW RRD DATAFORMAT with Accessor Functions
2 ==========================================
4 Interested:
6 Tobias Oetiker <oetiker@ee.ethz.ch>
7 Jake Brutlag <jakeb@microsoft.com>  
8 - updating rrd_update to use accessor fks
9 Karl Schilke <karl_schilke@eli.net> 
10 - changeing data access to mmap
13 Plan:
15 Encapsulating access to the RRD files through
16 special accessor functions which provide
17 access to the datastructures within the
18 RRDfiles. 
20 pseudo code by Jake
22 For example, here is a current code block from rrd_update.c:
24         for (i=0;i<rrd.stat_head->ds_cnt;i++) {
25         if(isnan(pdp_new[i]))
26             rrd.pdp_prep[i].scratch[PDP_unkn_sec_cnt].u_cnt += interval;
27         else
28             rrd.pdp_prep[i].scratch[PDP_val].u_val+= pdp_new[i];
29           }
31 This could read:
33         for (i=0 ; i < getDSCount(&rrd) ;i++) {
34         if(isnan(pdp_new[i])) {
35             temp = getPDPParam(&rrd, i, PDP_unkn_sec_cnt);
36             temp.u_cnt += interval;
37             setPDPParam(&rrd, i, PDP_unkn_sec_cnt, temp);
38         } else {
39             temp = getPDPParam(&rrd, i, PDP_val);
40             temp.u_val += pdp_new[i];
41             setPDPParam(&rrd, i, PDP_val, temp);
42         }
43           }