Skip to content

Instantly share code, notes, and snippets.

@l1x
Created August 20, 2012 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save l1x/3407691 to your computer and use it in GitHub Desktop.
Save l1x/3407691 to your computer and use it in GitHub Desktop.
(def config [
{:jvm_name "datanode" :host_name "testdomain" :port 8008 :mbeans [] },])
(for [{h :host_name p :port} config]
(jmx/with-connection {:host h, :port p}
(map jmx/mbean (map (memfn getCanonicalName) (jmx/mbean-names "hadoop:*")))))
@l1x
Copy link
Author

l1x commented Aug 20, 2012

(Exception in thread "main" javax.management.InstanceNotFoundException: hadoop:name=DataNodeActivity-testdomain-50010,service=DataNode....

however this works:

(jmx/with-connection {:host "testdomain", :port 8008}
(jmx/mbean "hadoop:name=DataNodeActivity-testdomain-50010,service=DataNode"))

returns:

{:blockReportsMaxTime 206, :reads_from_local_client 0, :bytes_written 0, :blocks_read 0, :heartBeatsMaxTime 514359, :readBlockOpMinTime 0, :readBlockOpAvgTime 0, :blocks_written 0, :readBlockOpNumOps 0, :blockReportsNumOps 0, :copyBlockOpMaxTime 0, :copyBlockOpNumOps 0, :blocks_verified 0, :blockChecksumOpMinTime -1, :volumeFailures 0, :blocks_replicated 0, :writes_from_local_client 0, :blockChecksumOpAvgTime 0, :writeBlockOpMaxTime 234364, :copyBlockOpMinTime -1, :replaceBlockOpNumOps 0, :copyBlockOpAvgTime 0, :readBlockOpMaxTime 24722, :replaceBlockOpMinTime -1, :replaceBlockOpAvgTime 0, :blockReportsAvgTime 0, :bytes_read 0, :blockReportsMinTime 10, :heartBeatsNumOps 4, :heartBeatsMinTime 0, :heartBeatsAvgTime 0, :writeBlockOpMinTime 0, :writeBlockOpAvgTime 0, :writes_from_remote_client 0, :blockChecksumOpNumOps 0, :replaceBlockOpMaxTime 0, :blockChecksumOpMaxTime 0, :reads_from_remote_client 0, :block_verification_failures 0, :writeBlockOpNumOps 0, :blocks_removed 0}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment