Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elexx/guavajmx
A MBean management library for Google Guava
https://github.com/elexx/guavajmx
guava guava-cache jmx
Last synced: 6 days ago
JSON representation
A MBean management library for Google Guava
- Host: GitHub
- URL: https://github.com/elexx/guavajmx
- Owner: elexx
- License: apache-2.0
- Created: 2017-04-29T07:37:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-30T16:47:38.000Z (over 7 years ago)
- Last Synced: 2024-11-07T14:30:06.767Z (about 2 months ago)
- Topics: guava, guava-cache, jmx
- Language: Java
- Size: 66.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GuavaJmx
[![Build Status](https://travis-ci.org/elexx/guavajmx.svg?branch=master)](https://travis-ci.org/elexx/guavajmx)
Get insight in Guava via JMX.
## Building
Currently GuavaJmx is not deployed to Maven Central. So you have to clone and build it yourself.
```bash
$ git clone https://github.com/elexx/guavajmx.git
$ cd guavajmx
guavajmx$ ./gradlew install
```## Dependency
GuavaJmx dependents on the oldest Guava version it at least needs to run. So if you need a newer Guava Version just add an explicit dependency to Guava!
Add a dependency to GuavaJMX using Maven:
```xml
com.github.elexx
guavajmx
0.0.1-SNAPSHOT```
Add a dependency to GuavaJMX using Gradle:
```
dependencies {
compile 'com.github.elexx:guavajmx:0.0.1-SNAPSHOT'
}
```## Usage
### Cache
When building the Cache with Guava >12.0, don't forget to call `.recordStats()` otherwise the JMX bean will not show any statistics.
```
Cache myCache = newBuilder()
.recordStats()
.build();
```Register the bean with JMX:
```
GuavaJmxManagementService.register(myCache, "Name to be shown in JMX client");
```