Trackers

The tracker classes are monitoring events in the event bus and are producing metric values. You most certainly need them in order to collect your results.

Refer to the Event Reference to know the events broadcasted in the bus.

DurationTracker

class performance.driver.classes.tracker.DurationTracker(*args, **kwargs)[source]

Tracks the duration between a start and an end event.

trackers:
  - class: tracker.DurationTracker

    # The metric where to write the measured value to
    metric: someMetric

    # The relevant events
    events:

      # The event to start counting from
      # (This can be a filter expression)
      start: StartEventFilter

      # The event to stop counting at
      # (This can be a filter expression)
      end: EndEventFilter

This tracker always operates within a tracking session, initiated by a ParameterUpdateEvent and terminated by the next ParameterUpdateEvent, or the completion of the test.

Important

The start and end events must contain the trace IDs of the originating ParameterUpdateEvent. Otherwise they won’t be measured.

EventAttributeTracker

class performance.driver.classes.tracker.EventAttributeTracker(*args, **kwargs)[source]

The Event Value Tracker is extracting a value of an attribute of an event into a metric.

trackers:
  - class: tracker.EventAttributeTracker

    # The event filter to handle
    event: HTTPResponseEnd

    # One or more attributes to extract
    extract:

      # The metric where to write the result
      - metric: metricName

        # [OR] The attribute to extract the value from
        attrib: attribName

        # [OR] The expression to use to evaluate a value from the event
        eval: "event.attribute1 + event.attribute2"

    # [Optional] Extract the trace ID from the event(s) that match the
    # given filter. If missing, the trace ID of the event is used.
    traceIdFrom: ParameterUpdateEvent

This tracker is frequently used in conjunction with observers that broadcast measurements as single events.

For example you can use this tracker to extract JMX measurements as metrics:

trackers:
  - class: tracker.EventAttributeTracker
    event: JMXMeasurement
    extract:
      - metric: metricName
        attrib: "fields['jmxFieldName']""

Or you can extract raw log line messages as a metric:

trackers:
  - class: tracker.EventAttributeTracker
    event: LogLineEvent
    extract:
      - metric: metricName
        attrib: "line"

CountTracker

class performance.driver.classes.tracker.CountTracker(*args, **kwargs)[source]

Tracks the occurrences of an event within the tracking session.

trackers:
  - class: tracker.CountTracker

    # The metric where to write the measured value to
    metric: someMetric

    # The event to count
    # (This can be a filter expression)
    events: SomeEvent

    # [Optional] The increment step (this can be a python expression)
    step: 1

This tracker always operates within a tracking session, initiated by a ParameterUpdateEvent and terminated by the next ParameterUpdateEvent, or the completion of the test.

Important

The event must contain the trace IDs of the originating ParameterUpdateEvent, otherwise the events won’t be measured.

DumpMetricTracker

class performance.driver.classes.tracker.DumpMetricTracker(*args, **kwargs)[source]

The Dump Metric Tracker is dumping metrics collected by observers into the results.

trackers:
  - class: tracker.DumpMetricTracker

    # The mapping between the marathon metric and the configured metric
    map:
      gauges.jvm.memory.total.used.value: marathonMemTotalUsage
      gauges.jvm.memory.heap.used.value: marathonMemHeapUsage
      gauges.jvm.threads.count.value: marathonThreadsCount
      gauges.jvm.threads.blocked.count.value: marathonThreadsBlocked
      gauges.jvm.threads.waiting.count.value: marathonThreadsWaiting

This tracker is simply translating the name of the metric collected by an observer (usually the MarathonMetricsObserver) into the metric collected by the scale test.

LogStaxTracker

class performance.driver.classes.tracker.LogStaxTracker(*args, **kwargs)[source]

The Logstax Tracker is forwarding the values of the LogStax tokens as result metrics.

trackers:
  - class: tracker.LogStaxTracker

    # Which tokens to collect
    collect:

      # The name of the metric to store the resulting value
      - metric: nameOfMetric

        # A python expression evaluated at run-time and gives the value
        # to assign to the metric. You can use all definitions, parameters,
        # and field values in your scope
        value: "fieldInMessage * parameter / definition"

        # [Optional] Extract the trace ID from the event(s) that match the
        # given filter.
        traceIdFrom: ParameterUpdateEvent

        # [Optional] The filter to apply on LogStax messages
        filter:

          # [Optional] The message should have all the specified tags present
          all_tags: [ foo, bar ]
          tags: [ foo, bar ]

          # [Optional] The message should have some of the specified tags present
          some_tags: [ baz, bax ]

          # [Optional] The message should have all the specified fields present
          all_fields: [ foo, bar ]

          # [Optional] The message should have some of the specified fields present
          some_fields: [ foo, bar ]

          # [Optional] The message should have the given field values
          fields:
            foo: "foovalue"

You can use this tracker in combination with LogStaxObserver in order to collect useful tokens present in the log lines of the application being tested.