USER_EVENT in code tracing

Follow

Abstract

When examining a code trace in Zend Server, under certain circumstances a line showing USER_EVENT(X) will show. This line originates from the interaction of Zend Monitor and Zend Code Tracing, more precisely, a USER_EVENT(X) indicates that a monitoring event was triggered during the course of the request.

How it works

Zend Code Tracing is designed to capture the entire execution of a PHP request, and as such hooks into many of the internal mechanics of the engine, such as startup, shutdown, function call, function return, etc.

The Zend Monitor component adds an event of its own. That event gets triggered whenever any monitoring event is generated. Therefore whenever a request exceeds the time set in the Slow Request Execution rule, or exceeds the memory set in the High Memory Usage rule, or when a php error is triggered, or any of the other rules are matched, provided that the rule is enabled, an internal event gets triggered.

That internal event (a piece of the mechanics of Monitoring) is what shows up in a Code Trace as USER_EVENT(X). The X starts at 1 and gets incremented with every monitoring event hat gets triggered in the same request. If a request generates both a high memory usage and a slow request execution event, there will be 2 USER_EVENTS in the code trace, with X=1 and X=2.

Disabling the tracing of monitoring events

Finally it is important to note that tracing of monitoring events can be disabled altogether. In the UI, under Configurations (ZS 6.X-8.X) > Components > Code Tracing set:

zend_codetracing.trace_events to off

 

Have more questions? Submit a request

Comments

Powered by Zendesk