On Thu, May 6, 2010 at 3:24 PM, Bernard Li <[email protected]> wrote: > Hi David: > > On Thu, May 6, 2010 at 2:24 PM, David Birdsong <[email protected]> > wrote: > >> here's the relevant descriptor info: >> >> desc_template = { >> 'call_back': self.get_metric, >> 'time_max': self.collect_interval, >> 'value_type': 'uint', >> 'units': 'ticks', >> 'slope': 'both', >> 'format': '%u', >> 'groups': metric_group >> } >> descriptor = desc_template.copy() >> descriptor['name'] = '%s.http_req_time' % component >> descriptor['description'] = 'http request time to serve' >> descriptor['value_type'] = 'float' >> descriptor['format'] = '%u', >> descriptors.append(descriptor) >> >> >> ...so to recap, gmond debug shows the collection going as expected >> with, but after the collection of the metric and before gmetric >> collects the xml from the collector, the value is changed into a large >> integer. >> >> also, what is format? the docs simply mention that the format field is >> the format of the metric. > > The "format" here is simply the string format operation for Python as > referenced here: > > http://docs.python.org/library/stdtypes.html#string-formatting > > So for your case, instead of '%u', it should be '%f'. I have added > the above link to the Wiki page describing the Python module. ah, thanks. i tried this as a guess that it should probably be '%f' for floats.
> > Have you tried running your plugin on the command line to see whether > your float was also converted to a large integer? yes, both the cmd line and running gmond -d with print statements in the module display a float as expected. i've since just convereted 1.xx seconds to milliseconds and now i'm pretty happy with int as a precise enough data type. this doesn't explain why the values increment endlessly though when represented as floats and simply converting to ints solves the problem. > Cheers, > > Bernard > ------------------------------------------------------------------------------ _______________________________________________ Ganglia-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ganglia-general

