Skip to content

Instantly share code, notes, and snippets.

@codahale
Created February 24, 2010 02:42
Show Gist options
  • Select an option

  • Save codahale/313021 to your computer and use it in GitHub Desktop.

Select an option

Save codahale/313021 to your computer and use it in GitHub Desktop.
class Monitored extends SomeClass with JmxManaged {
val currentThings = new AtomicLong
val totalThings = new AtomicLong
enableJMX() { jmx =>
jmx.addAttribute("total-things") { totalThings.get }
jmx.addAttribute("current-things") { currentThings.get }
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment