Ticket #156 (closed enhancement: fixed)
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
Change History
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



