[collectd-changes] collectd, the system statistics collection daemon: Changes to 'collectd-4.8'

Florian Forster octo at verplant.org
Thu Feb 4 13:08:47 CET 2010


 src/collectd.h          |    6 ++++++
 src/utils_format_json.c |    7 ++++++-
 2 files changed, 12 insertions(+), 1 deletions(-)

New commits:
commit 5233d6b54dbae48b7604a3dedaee493a64d31cbf
Author: Florian Forster <octo at huhu.verplant.org>
Date:   Thu Feb 4 13:07:43 2010 +0100

    src/utils_format_json.c: Use "isfinite" rather than "isinf".
    
    Makes it a bit easier to read.

commit e0b3aa9ba8254ab29d86b294553a5413b7efa59a
Author: Florian Forster <octo at huhu.verplant.org>
Date:   Thu Feb 4 13:07:06 2010 +0100

    src/collectd.h: Add fallback implementations of "isfinite" and "isinf".

commit fdb6736cf312cd91bb7fcfc71393e6525c09cec8
Author: Chris Buben <cbuben at eventlogic.com>
Date:   Thu Feb 4 00:52:30 2010 -0800

    utils_format_json: serialize nan and inf as null, as per JSON spec
    
    I'm deserializing JSON output from the write_http plugin using ruby-yajl.
    yajl was puking on the literal value nan encoded in the output.
    
    [
        {
            "plugin": "memcached",
            "interval": 10,
            "host": "myhost",
            "values": [
                nan,
                5
            ],
            "time": 1265239180,
            "plugin_instance": "",
            "type_instance": "",
            "type": "ps_count"
        }
    ]
    
    After some research, ECMA-262 15.12.3 says nan and infinite numbers
    aren't representable in JSON and should be serialized as the string
    null. I figure any strictly-compliant JSON parser will fail on parsing
    JSON data containing nans as emitted by collectd's utils_format_json
    routines.
    
    This patch makes collectd's JSON output compliant in the case of
    infinite or nan gauge values.
    
    Signed-off-by: Florian Forster <octo at huhu.verplant.org>




More information about the collectd-changes mailing list