Ticket #156 (closed enhancement: fixed)

Opened 4 years ago

Last modified 4 years ago

DST_CDEF support in python bindings

Reported by: human Owned by: oetiker
Priority: minor Milestone:
Component: misc Version: 1.2.25
Keywords: python bindings Cc:

Description

The python bindings do not currently support retrieval of the rpn expression in COMPUTE data sources. Attached is a patch that duplicates functionality from rrd_info.c to expose the correct data source attributes via the python binding. It:

  • exposes the rpn expression in the 'cdef' element for DST_CDEF data source types
  • exposes the heartbeat, min, and max only to the other data source types

This issue is present in trunk, the attached patch is against branches/1.2.

Attachments

dst_cdef.patch Download (1.5 KB) - added by human 4 years ago.

Change History

Changed 4 years ago by human

comment:1 Changed 4 years ago by oetiker

  • Status changed from new to closed
  • Resolution set to fixed

thanks for your patch .. integrated it in the 1.2 branch. Why do you write that the bug was present in trunk too ? the trunk python bindings contain totally different info code ... can you please test ?

comment:2 Changed 4 years ago by human

My apologies, the cdef is exposed with the python bindings in trunk. Unfortunately, the new bindings lost something pythonic here. A dict with keys:

'ds[sum].unknown_sec': 3L, 'ds[sum].minimal_heartbeat': 120L,

is not as useful as:

'ds' : {

'sum' : { 'unknown_sec': 3L, 'minimal_heartbeat': 120L, }

}

and that's a significant change to the interface - why was that done (sorry I'm late to the discussion)?

  • Gilad

comment:3 Changed 4 years ago by oetiker

The reason is consistency. If you want to dissect the key into a multilevel hash structure this is fine, but it should be done outside the info method. Info must return the same thing on all platforms, and this is a single level hash. I know this change breaks compatibility, but the situation before was simply untenable. (I should pay better attention before accepting bindings code).

cheers tobi

Note: See TracTickets for help on using tickets.

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.