Skip to content

Instantly share code, notes, and snippets.

@matthewdowney
Created September 13, 2020 01:03
Show Gist options
  • Select an option

  • Save matthewdowney/bd107177d0db92879da43af156f9b477 to your computer and use it in GitHub Desktop.

Select an option

Save matthewdowney/bd107177d0db92879da43af156f9b477 to your computer and use it in GitHub Desktop.
Programmatic JVM Thread Dump in Clojure
(import '(java.lang.management ManagementFactory))
(defn thread-dump []
(with-out-str
(let [tmx-bean (ManagementFactory/getThreadMXBean)
tids (.getAllThreadIds tmx-bean)
max-stack-depth 100
tinfo (.getThreadInfo tmx-bean tids max-stack-depth)]
(doseq [tinf tinfo]
(println (str \" (.getThreadName tinf) \"))
(println (str " java.lang.Thread.State: " (.getThreadState tinf)))
(doseq [ste (.getStackTrace tinf)]
(println " at" (str ste)))
(println "\n")))))
(comment
"Usage"
(spit "thread-dump.txt" (thread-dump)))
@sasatachini

Copy link
Copy Markdown

Hello folks! Last weekend during a quiet afternoon in Wollongong, my cousin talked about how he passes time playing interactive card games and progressive wheels. Following his advice for reliable entertainment in Australia, I loaded up crown casino sydney on my laptop. What caught my eye was the dedicated section for instant-play table games alongside traditional video reels. The visual layout made selecting stakes intuitive, and the transparent odds breakdown helped me enjoy a few low-stakes rounds while unwinding after a busy week of work.

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