Skip to content

Configuration sample

cyrille-leclerc edited this page Mar 26, 2013 · 4 revisions

Detailed sample

{
 "queries": [
   {
     "objectName": "cocktail:type=CocktailManager,name=CocktailManager",
     "resultAlias": "cocktail.cocktailmanager",
     "attribute": "AddedCommentCount"
   },
   {
     "objectName": "java.lang:type=GarbageCollector,name=PS MarkSweep",
     "resultAlias": "jvm.gc.ps-marksweep",
     "attributes": ["CollectionCount", "CollectionTime"]
   },
   {
     "objectName": "java.lang:type=GarbageCollector,name=PS Scavenge",
     "resultAlias": "jvm.gc.ps-scavenge",
     "attributes": ["CollectionCount", "CollectionTime"]
   },
   {
     "objectName": "java.lang:type=Memory",
     "resultAlias": "jvm.memory",
     "attributes": [
       {
         "name": "HeapMemoryUsage",
         "keys": ["committed", "init", "max", "used"]
       },
       {
         "name": "NonHeapMemoryUsage",
         "keys": ["committed", "init", "max", "used"]
       }
     ]
   },
   {
     "objectName": "java.lang:type=Threading",
     "resultAlias": "jvm.thread",
     "attributes": ["ThreadCount", "TotalStartedThreadCount", "DaemonThreadCount"]
   },
   {
     "objectName": "java.lang:type=Runtime",
     "resultAlias": "jvm.runtime",
     "attribute": "Uptime"
   },
   {
     "objectName": "java.lang:type=OperatingSystem",
     "resultAlias": "jvm.operatingsystem",
     "attributes": ["SystemLoadAverage", "ProcessCpuTime", "FreePhysicalMemorySize", "FreeSwapSpaceSize"]
   }
 ],
 "outputWriters": [
   {
     "@class": "org.jmxtrans.embedded.output.Slf4jWriter"
   },
   {
     "@class": "org.jmxtrans.embedded.output.GraphiteWriter",
     "settings": {
       "host": "${graphite.host:localhost}",
       "port": "${graphite.port:2003}"
     }
   }
 ],
 "queryIntervalInSeconds": "${jmxtrans.queryIntervalInSeconds:30}",
 "numQueryThreads": "${jmxtrans.numQueryThreads:1}",
 "numExportThreads": "${jmxtrans.numExportThreads:1}",
 "exportIntervalInSeconds": "${jmxtrans.exportIntervalInSeconds:5}",
 "exportBatchSize": "${jmxtrans.exportBatchSize:50}"
}

Default values if nothing is declared in the json configuration file (see EmbeddedJmxTrans.java)

  • queryIntervalInSeconds: 30
  • numQueryThreads: 1
  • numExportThreads:1
  • exportIntervalInSeconds: 5
  • exportBatchSize: 50