This appendix covers the event aggregation mechanism in the Central Server. It will try to answer the fundamental question: "When are two events considered to be of the same origin (or cause) and therefore reported as one?"
To answer this question we first have to define the different properties (or attributes) that define an event. Here is a list of the attributes that are used for aggregation along with a short definition:
Event type - the type of the error that triggered the event (PHP error, Function error etc'). Perhaps the most important property since it also determines which other properties will be compared.
Source file, Line number - the name of the PHP file and the line that contains the code that triggered the event. This file may not be the file that the user requested. Not all events have code location - e.g., "slow script" events and other events related to the whole script do not.
Function name - the name of the function that contains the code that triggered the event. If the event happened in the global scope it's reported in the 'main' function.
Location - one of two: either the server id of the server that triggered the event or the group id if the server belonging to an aggregated group.
Aggregation Hint - this is a string that is supplied by the user to differentiate between pages that have the same URL but different parameters. If the user did not supply a hint the default hint is an empty string (The limit for Aggregation hints is 255 chars, longer hints will not be aggregated).
Error text - the error text that was attached to the event.
Script id - refers to the record for the script that the user requested (i.e., derived from original request URL).
Severity - the severity of the event - currently, has two levels - regular and severe.
Another property that is taken into account is the event status. Only events that are not closed are aggregated.
Events are not aggregated when they are one of the following:
Events of different types.
Events that happened on different non-aggregated servers.
Events with different aggregation hints.
Events with different severity.
The following properties must be equal for events that are of type "zenderror":
Type (note: this is a Zend error type, like E_WARNING, not monitor error type)
Source file
Line number
Function name
Location
Aggregation hint
The Error text attribute must be 75% similar. (To learn more about text similarity read http://uk.php.net/manual/en/function.similar-text.php)
The following properties must be equal for events that are of type "funcerror" or "dberror":
Source file
Line number
Function name
Location
Aggregation hint
If one of the events has an Error text attribute than the Error texts must be the same (not similar!).
The following properties must be equal for events that are of type "longfunction" or "longquery":
Script id
Source file
Line number
Function name
Location
Aggregation hint
Severity
The following properties must be equal for custom events:
Type (this is the first parameter user provides)
Severity
Event text
Source file
Line number
The rest of the events are aggregated according to following attributes if two conditions are met:
The event type is one of the following: "devmem", "memsize", "devscript", "outsize" or "longscript".
The event has a script id attribute
For these events the following attributes must be equal:
Type
Script id
Location
Severity