default: true
input:
  module: jolokia
  metricset: jmx
  defaults:
    namespace: 'queue'
    jmx.mappings:
    - mbean: 'org.apache.activemq:brokerName=*,destinationName=*,destinationType=Queue,type=Broker'
      attributes:
      - attr: Name
        field: name
      - attr: QueueSize
        field: size
      - attr: AverageEnqueueTime
        field: messages.enqueue.time.avg
      - attr: AverageMessageSize
        field: messages.size.avg
      - attr: ConsumerCount
        field: consumers.count
      - attr: DequeueCount
        field: messages.dequeue.count
      - attr: DispatchCount
        field: messages.dispatch.count
      - attr: EnqueueCount
        field: messages.enqueue.count
      - attr: ExpiredCount
        field: messages.expired.count
      - attr: InFlightCount
        field: messages.inflight.count
      - attr: MaxEnqueueTime
        field: messages.enqueue.time.max
      - attr: MemoryPercentUsage
        field: memory.broker.pct
      - attr: MinEnqueueTime
        field: messages.enqueue.time.min
      - attr: ProducerCount
        field: producers.count
processors:
  - script:
      lang: javascript
      source: >
        function process(event) {
          var queue_memory_broker_pct = event.Get("activemq.queue.memory.broker.pct")
          if (queue_memory_broker_pct != null) {
            event.Put("activemq.queue.memory.broker.pct", queue_memory_broker_pct / 100.0)
          }
        }
