python-rrdtool icon indicating copy to clipboard operation
python-rrdtool copied to clipboard

Correct custom fetch callback examples

Open jchristgit opened this issue 2 years ago • 0 comments

The callback was previously erroring out because of this error:

  File "test.py", line 33, in my_callback
    'a': [math.sin(x / 200) for x in range(0, itemcount)],
                                     ^^^^^^^^^^^^^^^^^^^
TypeError: 'float' object cannot be interpreted as an integer

Unfortunately this is only visible if one wraps the function in a manual error handler (it just returns NULL in case it errors, apparently). There was also a small typo with the callback name and the way the graphv args were passed.

jchristgit avatar Apr 29 '23 15:04 jchristgit