Zend Monitor - PHP API

This topic lists the PHP API functions of the Zend Monitor.

Zend Monitor Functions

Function

Description

zend_monitor_pass_error

Passes an error to the Monitor component with file and line details. This function is used in error handlers. An alternative is to use trigger_error. However, this function does not indicate the file name and line number - it only passes the error message.

zend_monitor_custom_event

Creates a special (custom) event that is generated from your code. The information collected consists of the three following parameters: Class, Text and User Data.

zend_monitor_custom_event_ex

Creates a special (custom) event that is specified by a rule name. The information collected consists of the four following parameters: Class, Text, Rule name and User Data.

zend_monitor_set_aggregation_hint

Incorporates the locations of occurrences in the script when there are events that require those locations for diagnosing the reason an event occured. Only events of the same type are aggregated. The collected information is viewed in the Zend Server User Interface.

zend_monitor_event_reporting

Enables or disables the event reporting of some event types by passing a bit-mask (as done by PHP's error_reporting function), but with the constants listed above, in ZEND_MONITOR_ET*. Note: You cannot enable events that are disabled in the Event Rules file.

Zend Monitor Constants

Constant

Type

Available Since Version

Description

ZEND_MONITOR_ETBM_ALL

int

4.0

Bitmask Representing all Event Types(for zend_monitor_event_reporting)

ZEND_MONITOR_ETBM_NONE

int

4.0

Bitmask Representing NO Monitoring Events (for zend_monitor_event_reporting)

ZEND_MONITOR_ETBM_CUSTOM

int

4.0

Custom Event-Type Bitmask(for zend_monitor_event_reporting)

ZEND_MONITOR_ETBM_FUNC_SLOW_EXEC

int

4.0

Function Slow Execution Event-Type Bitmask(for zend_monitor_event_reporting)

ZEND_MONITOR_ETBM_FUNC_ERR

int

4.0

Function Error Event-Type Bitmask(for zend_monitor_event_reporting)

ZEND_MONITOR_ETBM_REQ_SLOW_EXEC

int

4.0

Request Slow Execution Event-Type Bitmask(for zend_monitor_event_reporting)

ZEND_MONITOR_ETBM_REQ_REL_SLOW_EXEC

int

4.0

Request Relative Slow Execution Event-Type Bitmask(for zend_monitor_event_reporting)

ZEND_MONITOR_ETBM_REQ_LARGE_MEM_USAGE

int

4.0

Request Large Memory Usage Event-Type Bitmask(for zend_monitor_event_reporting)

ZEND_MONITOR_ETBM_REQ_REL_LARGE_MEM_USAGE

int

4.0

Request Relative Large Memory Usage Event-Type Bitmask(for zend_monitor_event_reporting)

ZEND_MONITOR_ETBM_REQ_LARGE_OUT_SIZE

int

4.0

Request Relateive Large Output Size Event-Type Bitmask(for zend_monitor_event_reporting)

ZEND_MONITOR_ETBM_ZEND_ERR

int

4.0

Zend/PHP Error Event-Type Bitmask(for zend_monitor_event_reporting)

ZEND_MONITOR_ETBM_JAVA_EXP

int

4.0

Unhandled Java Exception Event-Type Bitmask(for zend_monitor_event_reporting)

ZEND_MONITOR_ETBM_JQ_JOB_EXEC_ERROR

int

4.0

Job Queue - Job Execution Error Event-Type Bitmask

ZEND_MONITOR_ETBM_JQ_JOB_LOGICAL_FAILURE

int

4.0

Job Queue - Job Logical Error Event-Type Bitmask(for zend_monitor_event_reporting)

ZEND_MONITOR_ETBM_JQ_JOB_EXEC_DELAY

int

4.0

Job Queue - Job Execution Delayed Event-Type Bitmask(for zend_monitor_event_reporting)

ZEND_MONITOR_ETBM_JQ_DAEMON_HIGH_CONCURRENCY_LEVEL

int

4.0

Job Queue - Daemon High Concurrency Event-Type Bitmask(for zend_monitor_event_reporting)

ZEND_MONITOR_ETBM_ET_TRACER_FILE_WRITE_FAIL

int

4.0

Tracer - Failed to write a dump file Event-Type Bitmask(for zend_monitor_event_reporting)

ZEND_MONITOR_ET_JQ_JOB_EXEC_ERROR

int

4.0

Job Queue - Job Execution Error Event-Type Bitmask

ZEND_MONITOR_ET_JQ_JOB_LOGICAL_FAILURE

int

4.0

Job Queue - Job Logical Error Event-Type

ZEND_MONITOR_ET_JQ_JOB_EXEC_DELAY

int

4.0

Job Queue - Job Execution Delayed Event-Type

ZEND_MONITOR_ET_JQ_DAEMON_HIGH_CONCURRENCY_LEVEL

int

4.0

Job Queue - Daemon High Concurrency Event-Type

ZEND_MONITOR_ET_TRACER_FILE_WRITE_FAIL

int

4.0

Tracer - Failed to write a dump file Event-Type

ZEND_MONITOR_EVENT_SEVERITY_INFO

int

6.1

Event severity info

ZEND_MONITOR_EVENT_SEVERITY_WARNING

int

6.1

Event severity warning

ZEND_MONITOR_EVENT_SEVERITY_ERROR

int

6.1

Event severity error

zend_monitor_pass_error

Passes an error to the Monitor component with file and line details. This function is used in error handlers. An alternative is to use trigger_error. However, this function does not indicate the file name and line number - it only passes the error message.

Available Since Version: 4.0

Parameter

Type

Required

Description

errno

int

Yes

Error code

errstr

string

Yes

Error string

errfile

string

Yes

Error file

errline

int

Yes

Error Line

zend_monitor_custom_event

Creates a special (custom) event that is generated from your code. The information collected consists of the three following parameters: Class, Text and User Data.

Available Since Version: 4.0

Parameter

Type

Required

Description

class

string

Yes

Event type.

text

string

Yes

String to appear in the event.

user_data

mixed

Yes

Optional: Any additional data to store with the event.

severity

int

Yes

Severity. One of the three options severity level (Info, Warning, Error).

zend_monitor_custom_event_ex

Creates a special (custom) event that is specified by a rule name. The information collected consists of the four following parameters: Class, Text, Rule name and User Data.

Available Since Version: 6.1

Parameter

Type

Required

Description

class

string

Yes

Event type.

text

string

Yes

String to appear in the event.

rule_name

string

Yes

Name of the rule.

user_data

mixed

Yes

Optional: Any additional data to store with the event

zend_monitor_set_aggregation_hint

Incorporates the locations of occurrences in the script when there are events that require those locations for diagnosing the reason an event occured. Only events of the same type are aggregated. The collected information is viewed in the Zend Server User Interface.

Available Since Version: 4.0

Parameter

Type

Required

Description

hint

string

Yes

Aggregation hint string.

Return Value: void -

zend_monitor_event_reporting

Enables or disables the event reporting of some event types by passing a bit-mask (as done by PHP's error_reporting function), but with the constants listed above, in ZEND_MONITOR_ET*. Note: You cannot enable events that are disabled in the Event Rules file.

Available Since Version: 4.0

Parameter

Type

Required

Description

new_error_reporting

int

No

The new error reporting level to use.

Return Value: int - The previous error_reporting level or FALSE if there is an error.