-
-
Save vijaykiran/af2e46da2c178831bf26 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ jol_test cat core.clj | |
(ns jol-test.core | |
(:import (org.jolokia.client.request J4pReadRequest) | |
(org.jolokia.client J4pClient))) | |
(defn fetch-data [] | |
(let [client (-> (. J4pClient url "http://localhost:8080/Jolokia/") | |
(.connectionTimeout 3000) | |
(.build)) | |
PeakThreadCount (J4pReadRequest. "java.lang:type=Threading" (into-array String ["PeakThreadCount"])) | |
HeapMemoryUsage (J4pReadRequest. "java.lang:type=Memory" (into-array String ["HeapMemoryUsage"]))] | |
(doseq [x (into [] (.execute client [HeapMemoryUsage PeakThreadCount]))] | |
(println (.getValue x))))) | |
(defn -main | |
[& args] | |
(fetch-data)) | |
➜ jol_test lein run | |
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8 | |
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8 | |
#<JSONObject {"max":3817865216,"committed":257425408,"init":268435456,"used":30902008}> | |
19 | |
➜ jol_test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment