Working with Code Tracing

In this Topic Hide

Setting a Monitor Rule to Run a Code Trace

Manually Triggering a URL Trace

Running Code Tracing on Another Machine

Viewing Trace Information

Viewing Trace Information Inside an Event

Viewing all Trace Information

Exporting Trace Information

Deleting Trace Information

 

Code Tracing records execution activity in real-time. This provides an in-depth diagnostic tool that will allow you to drill-down to the function level to view actual performance related information and statistics.

 

In order to work with Code Tracing you first have to have the Code Tracing component installed and activated (see the Installation Guide for information on adding components and to see Working with Components for information on the components in your system).

Setting a Monitor Rule to Run a Code Trace

This procedure describes how to define monitor rule settings to in addition to the event related information also collect trace information when the event is generated.

 

 

Instructions on how to complete a procedure

 

watch_video_s.png

To set a monitor rule to save trace data:

  1. Go to Rule Management | Monitoring.

  2. Select a rule from the list.

  3. Click Edit to open the rule for editing.

  4. Scroll down the page to "Step 2: Event Action"

  5. Select the one of the options and click add_pe.png.
    The Tracing options are:
    Save Trace Data - Generate a trace file each time the event is triggered.
    Activate Trace Data Collection for... -Generate a trace file for a given time frame each time an event is triggered.

  6. Scroll to the bottom (or the top) of the page and click Save to save changes.

The next time the event is triggered trace information for that specific occurrence will be collected. The trace information can be viewed in Monitor | Code Tracing or directly from the event (see important note below).

Important Note:

A single issue can contain aggregated information about more than one instance of an occurrence. This information is also grouped according to when the event occurred. When Code Trace information is collected it is collected for a specific time and therefore will be associated to a specific group inside the event for more information see  "Viewing Trace information Inside an Event".

Manually Triggering a URL Trace

This procedure describes how to manually run a code tracing on a specific URL. Running a code trace on a specific URL will capture the current activity at the time the trace was triggered.

 

 

Instructions on how to complete a procedure

 

watch_video_s.png

To manually trigger code tracing on a specific URL:

  1. Go to Monitor | Code Tracing.

  2. Enter the URL/IP in into the "Trace URL field and click trace_button.png
    The URL has to be running on the Server running Zend Server for IBM i.

The trace information will be collected and added to the list in the Code Tracing page.

Running Code Tracing on Another Machine

You can run Code Tracing on another machine as long as the Zend Code Trace component is installed and running on it. However, when running a trace on a remote machine the trace information is collected on that machine therefore, Instead of running the trace from a remote machine always run a trace on the specific machine you need. If you do want to run a trace on a remote server after all, make sure that the server's IP is an allowed host in Server Setup | Debugger.

Viewing Trace Information

There are two ways to view trace information according to how the trace was generated. Manually generated traces can be viewed in the Code Tracing page Monitor | Code Trace. Traces that were generated alongside an event can be viewed in the Code Tracing page Monitor | Code Trace and also from the issue's details.

Viewing Trace Information Inside an Event

This procedure describes how to view trace information that was collected at the time a monitor event was triggered.

Trace information for a monitor event is only collected if the specific event was defined to trigger a code trace.

 

 

Instructions on how to complete a procedure

 

watch_video_s.png

To view trace information inside an event:

  1. Go to Monitor | Events :

  2. Select an event from the list by clicking on the event's ID.
    The Issue Details page will be displayed.

  3. In the occurrences section, navigate to the time that the trace was supposed to run. clicking on that group will add an additional "View Trace" button to the display. Clicking on it will open the Code Tracing view where you will be able to see the trace information.

See Code Tracing Tree and Code Tracing Statistics for more information about the Zend Code Tracing view.

Viewing all Trace Information

This procedure describes how to view trace information for traces that were triggered manually or by an event.

The Code tracing view is populated after trace information has been collected either from an event or manually.

 

 

Instructions on how to complete a procedure

To view trace information:

  1. Go to Monitor | Code Tracing.

  2. Select a trace from the list by clicking on the trace's ID.
    The Code Tracing view will open in a new window.

Use the Code Tracing Tree and Code Tracing Statistics tabs to navigate through the information.

Exporting Trace Information

This procedure describes how to export trace information. Exported trace information can be used to be imported into Zend Studio for further diagnostic information when you do not have access to the server or if you have been sent trace information from another person.

 

 

Instructions on how to complete a procedure

 

watch_video_s.png

To export Zend Code Trace information:

  1. Go to Monitor | Events and select an event that has been set to collect trace information.

  2. In the event details page, click Export.
    A dialog will open prompting you to save the file to a location.
    The file will be created with a .zsf prefix for example "event_trace_20_25_0.7843.1.zsf"

The Zend Code Tracing file can be sent to any Zend Server user and imported as an event file into Zend Studio. For more information on how to import a trace file into Zend Studio see The Zend Studio Help

Deleting Trace Information

This procedure describes how to delete trace information.

 

 

Instructions on how to complete a procedure

  1. Go to Monitor | Code Tracing.

  2. Select a trace or multiple traces from the list by clicking the trace's check box.

  3. scroll to the bottom of the page and click delete.

The trace information will be permanently deleted. New trace information for the same URL will continue to be recreated as long as the setting in the rule is not changed. To change the rule's settings see "Setting a Monitor Rule to Run a Code Trace".

 

 

Related Links

Related Links:

Code Tracing   

Code Tracing Tree

Code Tracing Statistics

Zend Code Tracing

Zend Code Tracing - Configuration Directives