Hi guys,
I've uploaded an experimental tree to git://oss.sgi.com/nathans/pcp-json
which has:
- A libpcp_json JSON library, with good support for streaming data in
(parser supports partial input and stopping/restarting stream, etc)
- Initial code in pmproxy for proxying JSON protocol to native PCP and
vice-versa. This currently only supports a couple of the PCP PDUs
in their entirety, but some code is in place to support the rest (it
needs a fair bit more work though).
Getting it out there now for some early feedback and to get the JSON
library I've been using available to others who might need it now. I
would not recommend assuming this tree will remain in its current form
when it comes time to merge this all, will probably merge a clean patch
(so take care cloning this tree!)
Here's a simple example of requesting a metric descriptor via a proxy
host - cloud is running Mac OS X, verge is running Linux... (reply has
a tab-offset for legibility)
nathans@verge:/source/git/nathans/pcp-json/src/pmproxy$ gdb -q --args ./pmproxy
-f
Reading symbols from /source/git/nathans/pcp-json/src/pmproxy/pmproxy...done.
(gdb) r
Starting program: /source/git/nathans/pcp-json/src/pmproxy/pmproxy -f
[leave running]
nathans@verge:~$ telnet localhost 44322
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
[input]
{
"proxy" : {
"version" : 1,
"host" : "cloud",
"port" : 44321
},
"desc" : {
"pmid" : "78.7.50"
},
"desc" : {
"pmid" : "2.0.2"
}
}
[output]
"desc" : {
"pmid" : "78.7.50",
"indom" : "78.2",
"units" : "Kbyte",
"type" : "u64",
"sem" : "counter"
}
"desc" : {
"pmid" : "2.0.2",
"units" : "none",
"type" : "u32",
"sem" : "instant"
}
^]q
telnet> q
cheers.
--
Nathan
|