>>> On 5/6/2010 at 5:57 PM, in message <l2qd4c731da1005061657xf03acf27x1f1b19b4a7909...@mail.gmail.com>, Bernard Li <bern...@vanhpc.org> wrote: > Hi David: > > On Thu, May 6, 2010 at 3:39 PM, David Birdsong <david.birds...@gmail.com> > wrote: > >> 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. > > 'value_type' and 'format' needs to match up in the descriptor. If you > wanted to do conversion, do it in your handler, it should work that > way. > > However, I'm not sure why if there is a mismatch between 'value_type' > and 'format' it would generate an ambigious value -- any ides Brad? > > Another thing is, instead of letting the user set the 'format', > shouldn't we just hardcode what they should be? >
The primary place in the code where the value type and format come together is at the point where the value is converted to a string and formatted into the XML tag. In this case, allowing the module to define the format also allows it to specify the precision that will ultimately show up in the XML output from gmond. I don't know if that is really a valuable feature or a good enough reason to not hardcode the format string for a given value type, but that is how it works now. Another place in the code where value type is very important is when the value is pushed through XDR. This is the process which packages a metric into a very small packet which can be passed between systems safely. In order for XDR to create the packet correctly, it has to know exactly what type of data it is dealing with. Otherwise the data will be packaged and unpackaged by XDR using the wrong types and who knows what you will end up with after that. Brad ------------------------------------------------------------------------------ _______________________________________________ Ganglia-general mailing list Ganglia-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ganglia-general