Ticket #156: dst_cdef.patch

File dst_cdef.patch, 1.5 KB (added by human, 4 years ago)
  • rrdtoolmodule.c

     
    4242#include "Python.h" 
    4343#include "rrd.h" 
    4444#include "rrd_extra.h" 
     45#include "rrd_rpncalc.h" 
    4546 
    4647static PyObject *ErrorObject; 
    4748extern int optind; 
     
    445446 
    446447        DICTSET_STR(d, "ds_name", rrd.ds_def[i].ds_nam); 
    447448        DICTSET_STR(d, "type", rrd.ds_def[i].dst); 
    448         DICTSET_CNT(d, "minimal_heartbeat", rrd.ds_def[i].par[DS_mrhb_cnt].u_cnt); 
    449         DICTSET_VAL(d, "min", rrd.ds_def[i].par[DS_min_val].u_val); 
    450         DICTSET_VAL(d, "max", rrd.ds_def[i].par[DS_max_val].u_val); 
     449 
     450        switch(dst_conv(rrd.ds_def[i].dst)) { 
     451            case DST_CDEF: 
     452                { 
     453                char *buffer = NULL; 
     454                rpn_compact2str((rpn_cdefds_t *) &(rrd.ds_def[i].par[DS_cdef]), 
     455                    rrd.ds_def, &buffer); 
     456                DICTSET_STR(d, "cdef", buffer); 
     457                } 
     458                break; 
     459            default: 
     460            DICTSET_CNT(d, "minimal_heartbeat", rrd.ds_def[i].par[DS_mrhb_cnt].u_cnt); 
     461            DICTSET_VAL(d, "min", rrd.ds_def[i].par[DS_min_val].u_val); 
     462            DICTSET_VAL(d, "max", rrd.ds_def[i].par[DS_max_val].u_val); 
     463            break; 
     464        } 
    451465        DICTSET_STR(d, "last_ds", rrd.pdp_prep[i].last_ds); 
    452466        DICTSET_VAL(d, "value", rrd.pdp_prep[i].scratch[PDP_val].u_val); 
    453467        DICTSET_CNT(d, "unknown_sec", rrd.pdp_prep[i].scratch[PDP_unkn_sec_cnt].u_cnt); 

NOTE: The content of this website is accessible with any browser. The graphical design though relies completely on CSS2 styles. If you see this text, this means that your browser does not support CSS2. Consider upgrading to a standard conformant browser like Mozilla Firefox or Opera but also Apple's Safari or KDE's Konqueror for example. It may also be that you are looking at a mirror page which did not copy the CSS for this page. Or if some pictu res are missing, then the mirror may not have picked up the contents of the inc directory.