Hi,
Looks like a nice addon. I tried to use it but no go. It didn’t like this json string:
{“host”:“Mark-M14x”,“version”:“2.0.6”,“process”:“mongod”,“uptime”:514.0,“uptimeEstimate”:511.0,“localTime”:{“$date”:“2012-07-24T14:51:21.599Z”},“globalLock”:{“totalTime”:5.13949613E8,“lockTime”:211012.0,“ratio”:4.1056943066518077E-4,“currentQueue”:{“total”:0,“readers”:0,“writers”:0},“activeClients”:{“total”:0,“readers”:0,“writers”:0}},“mem”:{“bits”:64,“resident”:45,“virtual”:259,“supported”:true,“mapped”:80,“mappedWithJournal”:160},“connections”:{“current”:8,“available”:19992},“extra_info”:{“note”:“fields vary by platform”,“page_faults”:12231,“usagePageFileMB”:26,“totalPageFileMB”:24378,“availPageFileMB”:17386,“ramMB”:12190},“indexCounters”:{“note”:“not supported on this platform”},“backgroundFlushing”:{“flushes”:8,“total_ms”:4,“average_ms”:0.5,“last_ms”:1,“last_finished”:{“$date”:“2012-07-24T14:50:47.669Z”}},“cursors”:{“totalOpen”:0,“clientCursors_size”:0,“timedOut”:0},“network”:{“bytesIn”:117121,“bytesOut”:605563,“numRequests”:137},“opcounters”:{“insert”:0,“query”:125,“update”:0,“delete”:0,“getmore”:11,“command”:13},“asserts”:{“regular”:0,“warning”:0,“msg”:0,“user”:0,“rollovers”:0},“writeBacksQueued”:false,“dur”:{“commits”:30,“journaledMB”:0.0,“writeToDataFilesMB”:0.0,“compression”:0.0,“commitsInWriteLock”:0,“earlyCommits”:0,“timeMs”:{“dt”:3060,“prepLogBuffer”:0,“writeToJournal”:0,“writeToDataFiles”:0,“remapPrivateView”:0}},“ok”:1.0}
which is what I get from mongo db when I call ‘db.serverStatus’
I can do the following:
JsonParser parser = new JsonParser();
JsonElement element = parser.parse(""+ status);
System.out.println(element.toString());
// JsonContainer dataSource = JsonContainer.Factory.newInstance(element.toString());
// statusTable.setContainerDataSource(dataSource);
but the commented out lines throw an exception. It looks like a call to toString should be made instead of the call that is being done…
Cheers,
Mark