Event Filters¶
-
class
performance.driver.core.eventfilters.
EventFilter
(expression)[source]¶ Various trackers in DC/OS Performance Test Driver are operating purely on events. Therefore it’s some times needed to use a more elaborate selector in order to filter the correct events.
The following filter expression is currently supported and are closely modeled around the CSS syntax:
EventName[attrib1=value,attrib2=value,...]:selector1:selector2:...
Where:
_Event Name_ is the name of the event or
*
if you want to match any event._Attributes_ is a comma-separated list of
<attrib> <operator> <value>
values. For example:method==post
. The following table summarises the different operators you can use for the attributes.Operator Description =
or==
Equal (case sensitive for strings) !=
Not equal >
,>=
Grater than / Grater than or equal <
,<=
Less than / Less than or equal ~=
Partial regular expression match ~==
Exact regular expression match <~
Value in list or key in dictionary (like in
)_Selector_ specifies which event out of many similar to chose. Valid selectors are:
Selector Description :first
Match the first event in the tracking session :last
Match the last event in the tracking session :nth(n)
:nth(n,grp)
Match the n-th event in the tracking session. If a grp
parameter is specified, the counter will be groupped with the given indicator.:single
Match a single event, globally. After the first match all other usages accept by default. :after(Xs)
Trigger after X seconds after the last event :notrace
Ignore the trace ID matching and accept any event, even if they do not belong in the trace session.
For example, to match every
HTTPRequestEvent
:HTTPRequestEvent
Or, to match every POST
HTTPRequestEvent
:HTTPRequestEvent[method=post]
Or, to match the last
HTTPResponseEndEvent
HTTPResponseEndEvent:last
Or, to match the
HTTPRequestStartEvent
that contains the string “foo”:HTTPResponseEndEvent[body~=foo]
Or match any first event:
*:first