Management Module regex efficiency in metric groupings

book

Article ID: 196788

calendar_today

Updated On:

Products

CA Application Performance Management Agent (APM / Wily / Introscope) CA Application Performance Management (APM / Wily / Introscope) INTROSCOPE DX Application Performance Management

Issue/Introduction

The Default MM contains metric grouping agent expression: (.*)\|(.*)\|(.*)

This appears to be poor in following ways (though I have not had time to evaluate whether improved expressions compile & run faster):  
1- () force groups to be captured but they are never used.
2- .* will match to end of string, then \| will backtrack to last |, then .* will again match to end of string, when next \| will force further backtracking to 2nd last |.  Using lazy match .*?\|.*?\|.* may be better - but then since we want to match all agents, why not just .*

 

Environment

Release : 10.7.0

Component : APM Agents

Resolution

The management module agent and metric expressions are not always evaluated regexes. Full regex evaluation is only the fall back position as many pattern matches are handled as other types of string matches by the optimizer - and the example cited here is one of those because the optimizer recognises that the expression matches all agents no further evaluation is performed..

So whilst the regex cited in this example would be inefficient if evaluated as regex this does not take place.

The optimizer is used in certain 'obvious' cases

- everything .*
- nothing
- prefix xyz.*
- suffix .*xyz

Also groups () do not affect the optimizer so (.*) is treated just like .*