GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - clojure/java.jmx: Produce and consume JMX beans from Clojure

BranchesTags
Open more actions menu

Latest commit

 

History

77 Commits
77 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
src
src
 
 
.gitignore
.gitignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
epl.html
epl.html
 
 
pom.xml
pom.xml
 
 

Repository files navigation

clojure.java.jmx

Produce and consume JMX beans from Clojure.

Releases and Dependency Information

This project follows the version scheme MAJOR.MINOR.PATCH where each component provides some relative indication of the size of the change, but does not follow semantic versioning. In general, all changes endeavor to be non-breaking (by moving to new names rather than by breaking existing names).

Latest stable release: 1.1.1

  • All Released Versions

  • Development Snapshot Versions

CLI/deps.edn dependency information:

org.clojure/java.jmx {:mvn/version "1.1.1"}

Leiningen dependency information:

[org.clojure/java.jmx "1.1.1"]

Maven dependency information:

<dependency>
  <groupId>org.clojure</groupId>
  <artifactId>java.jmx</artifactId>
  <version>1.1.1</version>
</dependency>

Usage

Full Documentation

(require '[clojure.java.jmx :as jmx])

What beans do I have?

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

What attributes does a bean have?

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

What is the value of an attribute?

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

Give me all the attributes:

(jmx/mbean "java.lang:type=Memory")
-> {:NonHeapMemoryUsage
     {:used 16674024, :max 138412032, :init 24317952, :committed 24317952},
    :HeapMemoryUsage
     {:used 18619064, :max 85393408, :init 0, :committed 83230720},
    :ObjectPendingFinalizationCount 0,
    :Verbose false}

Find an invoke an operation:

(jmx/operation-names "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:

(jmx/with-connection {:host "localhost", :port 3000}
  (jmx/mbean "java.lang:type=Memory"))
-> {:ObjectPendingFinalizationCount 0,
    :HeapMemoryUsage ... etc.}

Serve your own beans. Drop a Clojure ref into create-bean to expose read-only attributes for every key/value pair in the ref:

(jmx/register-mbean
  (jmx/create-bean
  (ref {:string-attribute "a-string"}))
  "my.namespace:name=Value")}

Developer Information

  • GitHub project
  • Bug Tracker
  • Continuous Integration

Building

  1. Clone the repo
  2. Make sure you have maven installed
  3. Run the maven build: mvn install will produce a JAR file in the target directory, and run all tests with the most recently-released build of Clojure.

License

Copyright © Stuart Halloway, Rich Hickey & contributors.

Licensed under the EPL. (See the file epl.html.)

About

Produce and consume JMX beans from Clojure

Resources

Readme
EPL-1.0 license

Contributing

Contributing
Activity
Custom properties

Stars

97 stars

Watchers

28 watching

Forks

23 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.