The count function evaluates expressions and counts the successful evaluations. The function will accept metric wildcards.
count ( groupselector metric | expression [ , ... ] )
- groupselector metric A wildcard group selector and metric name upon which the group must match. The match will select all groups matching the wildcard pattern, if they contain the given metric. The match will resolve to each metric on these groups.
- expression A metric expression.
sum(com.groupon.requesthandler.* count) # (1)
sum(1, 2, 3 + 4) # (2)
sum(com.groupon.requesthandler.Create count,
com.groupon.requesthandler.Delete count) # (3)
- Counts the number of request handlers, containing a metric
count
. - Counts the number of expressions and returns 3.
- Calculates the number of
Create
andDelete
request handlers with a metriccount
. Note that if one of them is absent, it will still calculate the remaining selectors.