Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,30 @@ Usage
What beans do I have?

```clojure
(jmx/mbean-names \"*:*\")
(jmx/mbean-names "*:*")
-> #<HashSet [java.lang:type=MemoryPool,name=CMS Old Gen,
java.lang:type=Memory, ...]
```

What attributes does a bean have?

```clojure
(jmx/attribute-names \"java.lang:type=Memory\")
(jmx/attribute-names "java.lang:type=Memory")
-> (:Verbose :ObjectPendingFinalizationCount
:HeapMemoryUsage :NonHeapMemoryUsage)
```

What is the value of an attribute?

```clojure
(jmx/read \"java.lang:type=Memory\" :ObjectPendingFinalizationCount)
(jmx/read "java.lang:type=Memory" :ObjectPendingFinalizationCount)
-> 0
```

Give me all the attributes:

```clojure
(jmx/mbean \"java.lang:type=Memory\")
(jmx/mbean "java.lang:type=Memory")
-> {:NonHeapMemoryUsage
{:used 16674024, :max 138412032, :init 24317952, :committed 24317952},
:HeapMemoryUsage
Expand All @@ -71,18 +71,18 @@ Give me all the attributes:
Find an invoke an operation:

```clojure
(jmx/operation-names \"java.lang:type=Memory\")
(jmx/operation-names "java.lang:type=Memory")
-> (:gc)
(jmx/invoke \"java.lang:type=Memory\" :gc)
(jmx/invoke "java.lang:type=Memory" :gc)
-> nil
```

Conneting to another process? Just run *any* of the above code
inside a with-connection:

```clojure
(jmx/with-connection {:host \"localhost\", :port 3000}
(jmx/mbean \"java.lang:type=Memory\"))
(jmx/with-connection {:host "localhost", :port 3000}
(jmx/mbean "java.lang:type=Memory"))
-> {:ObjectPendingFinalizationCount 0,
:HeapMemoryUsage ... etc.}
```
Expand All @@ -94,8 +94,8 @@ in the ref:
```clojure
(jmx/register-mbean
(jmx/create-bean
(ref {:string-attribute \"a-string\"}))
\"my.namespace:name=Value\")}
(ref {:string-attribute "a-string"}))
"my.namespace:name=Value")}
```

Developer Information
Expand Down