graphite-dev team mailing list archive
-
graphite-dev team
-
Mailing list archive
-
Message #00949
Re: [Question #159969]: How do you use the pickle format?
Question #159969 on Graphite changed:
https://answers.launchpad.net/graphite/+question/159969
Status: Open => Answered
Dave Rawks proposed the following answer:
the pickle format is quite a bit more efficient in on the carbon side of
things, but if you are writing your metric collector or proxy in perl
I'm thinking pickle is not what you want to do. At any rate in python
you want something like
data = [ metric_name, [(timestamp,value) for record in records] ]
serializedData = pickle.dumps(data, protocol=-1)
prefix = struct.pack("!L", len(serializedData))
message = prefix + serializedData
then use socket comms to send the message object.
--
You received this question notification because you are a member of
graphite-dev, which is an answer contact for Graphite.