Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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");
```