---
rules:
  - bean: org.eclipse.jetty.server.session:context=*,type=sessionhandler,id=*
    unit: s
    prefix: jetty.session.
    type: updowncounter
    metricAttribute:
      resource: param(context)
    mapping:
      sessionsCreated:
        unit: "{sessions}"
        type: counter
        desc: The number of sessions established in total
      sessionTimeTotal:
        type: counter
        desc: The total time sessions have been active
      sessionTimeMax:
        type: gauge
        desc: The maximum amount of time a session has been active
      sessionTimeMean:
        type: gauge
        desc: The mean time sessions remain active

  - bean: org.eclipse.jetty.util.thread:type=queuedthreadpool,id=*
    prefix: jetty.threads.
    unit: "{threads}"
    type: updowncounter
    mapping:
      busyThreads:
        desc: The current number of busy threads
      idleThreads:
        desc: The current number of idle threads
      maxThreads:
        desc: The maximum number of threads in the pool
      queueSize:
        desc: The current number of threads in the queue

  - bean: org.eclipse.jetty.io:context=*,type=managedselector,id=*
    prefix: jetty.io.
    metricAttribute:
      resource: param(context)
      id: param(id)
    mapping:
      selectCount:
        type: counter
        unit: "1"
        desc: The number of select calls

  - bean: org.eclipse.jetty.logging:type=jettyloggerfactory,id=*
    prefix: jetty.logging.
    mapping:
      LoggerCount:
        type: updowncounter
        unit: "1"
        desc: The number of registered loggers by name
