• Quick Start
  • Booting
  • Platform
  • Portals
  • References
    • API Reference TOI3
    • IIP Reference
  • Resources
ARRIS Enterprises, Inc. Confidential Information

TeiProfilerService

Class Summary

Extends:
  • ToiEventTarget

The TeiProfilerService interface is used to profile and measure various metrics that assist in determining how the application is performing from a performance standpoint. A feature of the interface is the capability to control the time window used for calculating metric average values TeiProfilerService#addMonitoredProperty.

Technical Preview:

This interface is a TECHNICAL PREVIEW, it may change.

Service:

This is a service and can be accessed through toi.profilerService
  • Methods
  • Members
  • Types
  • Events

Method Summary

addMonitoredProperty ( profilingId , property , timeSpan )

This methods adds a property to be monitored to an existing profiling session. This can be done before the session is started TeiProfilerService#startProfiling or to an ongoing session.

createProfilingSession ( monitoredName )  → profilingId

This method is used to create a profiling session. One profiling session can be used to monitor different properties but only the same property once. An application can create a profiling session to monitor itself or another application.

getSample ( profilingId , property )  → measure

This method is used to get a sample of the current value of the property. The measurement will be of type TeiProfilerService.MEASUREMENT_TYPE_SAMPLE.

getSupportedProperties ( applicationName )  → Array.<string>

This method returns a sequence of the properties the application supports.

releaseProfilingSession ( profilingId )

This method is used to release a profiling session. All ongoing profiling associated with this session will be stopped. All ongoing profiling sessions will be released upon application termination.

removeMonitoredProperty ( profilingId , property )

This method removes a property from a profiling session.

startProfiling ( profilingId )

This methods is used to start a profiling session. Applicable variable properties for this session will be reset to zero at the start of the session, see definition for each property above.

Type Definitions

TeiMeasurementType (Type: enum)

The measurement type is used to distinguish between sampling of a property or an average calculation.

  • MEASUREMENT_TYPE_AVERAGE
  • MEASUREMENT_TYPE_SAMPLE
TeiProfilingId (Type: number)

The session identifier type.

TeiThresholdSpecifier (Type: enum)

The threshold type specifies the subscription behaviour of the monitored property TeiProfilerService#subscribe.

  • THRESHOLD_GREATER_ONCE
  • THRESHOLD_GREATER_REPEAT
  • THRESHOLD_LESS_ONCE
  • THRESHOLD_LESS_REPEAT

Events

  • ON_THRESHOLD_REACHED

Methods

addMonitoredProperty ( profilingId , property , timeSpan )

This methods adds a property to be monitored to an existing profiling session. This can be done before the session is started TeiProfilerService#startProfiling or to an ongoing session.

Parameters:

Name Type Description
profilingId TeiProfilerService.TeiProfilingId

The identifier of the profiling session.

property string

The property.

timeSpan number

The profiling window in seconds used to calculate the average value. If timeSpan is non-zero, TeiProfilerService#getAverage will return the average value per second. The maximum timespan is 60 seconds. If timeSpan is zero TeiProfilerService#getSample will return the current value of the property.

Throws:

ToiOperationNotSupportedException

Raised if monitoring of the property is not supported. Raised if monitoring of the property with the given timeSpan is not supported.

ToiInvalidArgumentException

Raised if the profilingId or property is invalid.

createProfilingSession ( monitoredName )  → profilingId

This method is used to create a profiling session. One profiling session can be used to monitor different properties but only the same property once. An application can create a profiling session to monitor itself or another application.

Parameters:

Name Type Description
monitoredName string

The name of the application to be monitored.

Throws:

ToiOperationNotSupportedException

Raised if the monitored application does not support the monitored functionality.

ToiInvalidArgumentException

Raised if either the applicationId or the monitored application name is invalid.

Returns:

The identifier of the profiling session.

Type: TeiProfilerService.TeiProfilingId
getSample ( profilingId , property )  → measure

This method is used to get a sample of the current value of the property. The measurement will be of type TeiProfilerService.MEASUREMENT_TYPE_SAMPLE.

Parameters:

Name Type Description
profilingId TeiProfilerService.TeiProfilingId

The identifier of the profiling session.

property string

The property being profiled.

Throws:

ToiInvalidArgumentException

Raised if the profilingId is invalid.

ToiInvalidPreconditionException

Raised if profiling for this session has not been started or the property is not monitored, or the property is not configured to be monitored with valid timeSpan TeiProfilerService#addMonitoredProperty.

Returns:

The measurement.

Type: TeiProfilerService.TeiMeasurement
getSupportedProperties ( applicationName )  → Array.<string>

This method returns a sequence of the properties the application supports.

Parameters:

Name Type Description
applicationName string

The name of the application to be monitored.

Throws:

ToiInvalidArgumentException

Raised if the monitored application name is invalid.

Returns:

A sequence of the properties the application supports.

Type: Array.<string>
releaseProfilingSession ( profilingId )

This method is used to release a profiling session. All ongoing profiling associated with this session will be stopped. All ongoing profiling sessions will be released upon application termination.

Parameters:

Name Type Description
profilingId TeiProfilerService.TeiProfilingId

The identifier of the profiling session.

Throws:

ToiInvalidArgumentException

Raised if the profilingId is invalid or already has been released.

ToiInvalidPreconditionException

Raised if more than 32 sessions are created.

removeMonitoredProperty ( profilingId , property )

This method removes a property from a profiling session.

Parameters:

Name Type Description
profilingId TeiProfilerService.TeiProfilingId

The identifier of the profiling session.

property string

The property.

Throws:

ToiInvalidArgumentException

Raised if the profilingId or property is invalid.

startProfiling ( profilingId )

This methods is used to start a profiling session. Applicable variable properties for this session will be reset to zero at the start of the session, see definition for each property above.

Parameters:

Name Type Description
profilingId TeiProfilerService.TeiProfilingId

The identifier of the profiling session.

Throws:

ToiInvalidArgumentException

Raised if the profilingId is invalid.

ToiInvalidPreconditionException

Raised if the profiling session has already been started.

Members

ON_THRESHOLD_REACHED (Type: TeiProfilerThresholdReachedEvent) (value = 3300) (static, constant)

This is an Event identifier for TeiProfilerThresholdReachedEvent.

This method is called when the threshold is reached for an application property.

This constant can be also be accessed from toi.consts.TeiProfilerService.ON_THRESHOLD_REACHED.
CONST_PROPERTY_ECMASCRIPT_HEAP (Type: string) (value = 'const.ecmascript.heap') (static, constant)

The total amount of heap memory in bytes available to the EcmaScript engine.

This constant can be also be accessed from toi.consts.TeiProfilerService.CONST_PROPERTY_ECMASCRIPT_HEAP.
CONST_PROPERTY_GRAPHICS_MEMORY (Type: string) (value = 'const.graphics.memory') (static, constant)

The total amount of graphics memory in bytes available in the system.

This constant can be also be accessed from toi.consts.TeiProfilerService.CONST_PROPERTY_GRAPHICS_MEMORY.
CONST_PROPERTY_SYSTEM_MEMORY (Type: string) (value = 'const.system.memory') (static, constant)

The total amount of system memory in bytes available in the system.

This constant can be also be accessed from toi.consts.TeiProfilerService.CONST_PROPERTY_SYSTEM_MEMORY.
MEASUREMENT_TYPE_AVERAGE (Type: TeiProfilerService.TeiMeasurementType) (value = 1) (static, constant)

The measurement is the average value for a property.

This constant can be also be accessed from toi.consts.TeiProfilerService.MEASUREMENT_TYPE_AVERAGE.
MEASUREMENT_TYPE_SAMPLE (Type: TeiProfilerService.TeiMeasurementType) (value = 0) (static, constant)

The measurement is a sample of a property.

This constant can be also be accessed from toi.consts.TeiProfilerService.MEASUREMENT_TYPE_SAMPLE.
THRESHOLD_GREATER_ONCE (Type: TeiProfilerService.TeiThresholdSpecifier) (value = 0) (static, constant)
This constant can be also be accessed from toi.consts.TeiProfilerService.THRESHOLD_GREATER_ONCE.
THRESHOLD_GREATER_REPEAT (Type: TeiProfilerService.TeiThresholdSpecifier) (value = 1) (static, constant)
This constant can be also be accessed from toi.consts.TeiProfilerService.THRESHOLD_GREATER_REPEAT.
THRESHOLD_LESS_ONCE (Type: TeiProfilerService.TeiThresholdSpecifier) (value = 2) (static, constant)
This constant can be also be accessed from toi.consts.TeiProfilerService.THRESHOLD_LESS_ONCE.
THRESHOLD_LESS_REPEAT (Type: TeiProfilerService.TeiThresholdSpecifier) (value = 3) (static, constant)
This constant can be also be accessed from toi.consts.TeiProfilerService.THRESHOLD_LESS_REPEAT.
VAR_PROPERTY_ECMASCRIPT_GC_RECLAIMED (Type: string) (value = 'var.ecmascript.gc.reclaimed') (static, constant)

The number of bytes reclaimed by the EcmaScript engine on the latest garbage collection. TeiProfilerService#getAverage returns the average number of bytes reclaimed per garbage collection, taking only in consideration cases where the number bytes is >= 1.

This constant can be also be accessed from toi.consts.TeiProfilerService.VAR_PROPERTY_ECMASCRIPT_GC_RECLAIMED.
VAR_PROPERTY_ECMASCRIPT_GC_TIME (Type: string) (value = 'var.ecmascript.gc.time') (static, constant)

The time in milliseconds spent by the EcmaScript engine on the latest garbage collection. TeiProfilerService#getAverage returns the average time per garbage collection, taking only into consideration cases where time is >= 1 ms.

This constant can be also be accessed from toi.consts.TeiProfilerService.VAR_PROPERTY_ECMASCRIPT_GC_TIME.
VAR_PROPERTY_ECMASCRIPT_HEAP (Type: string) (value = 'var.ecmascript.heap') (static, constant)

The amount of heap memory in bytes in use by the EcmaScript engine.

This constant can be also be accessed from toi.consts.TeiProfilerService.VAR_PROPERTY_ECMASCRIPT_HEAP.
VAR_PROPERTY_ECMASCRIPT_HEAP_PEAK (Type: string) (value = 'var.ecmascript.heap.peak') (static, constant)

The peak on the amount of heap memory in bytes in use by the EcmaScript engine. Reset to zero at start of a profiling session TeiProfilerService#startProfiling.

This constant can be also be accessed from toi.consts.TeiProfilerService.VAR_PROPERTY_ECMASCRIPT_HEAP_PEAK.
VAR_PROPERTY_FRAME_TIME (Type: string) (value = 'var.frame.time') (static, constant)

The time in milliseconds it took to render the last frame.

This constant can be also be accessed from toi.consts.TeiProfilerService.VAR_PROPERTY_FRAME_TIME.
VAR_PROPERTY_FRAMES_DISPLAYED (Type: string) (value = 'var.frames.displayed') (static, constant)

The number of frames displayed. Reset to zero at start of a profiling session TeiProfilerService#startProfiling. TeiProfilerService#getAverage returns the average number of frames displayed per second.

This constant can be also be accessed from toi.consts.TeiProfilerService.VAR_PROPERTY_FRAMES_DISPLAYED.
VAR_PROPERTY_GRAPHICS_MEMORY (Type: string) (value = 'var.graphics.memory') (static, constant)

The amount of graphics memory in bytes in use for all applications.

This constant can be also be accessed from toi.consts.TeiProfilerService.VAR_PROPERTY_GRAPHICS_MEMORY.
VAR_PROPERTY_GRAPHICS_MEMORY_PEAK (Type: string) (value = 'var.graphics.memory.peak') (static, constant)

The peak on the amount of graphics memory in use for all applications. Reset to zero at start of a profiling session TeiProfilerService#startProfiling.

This constant can be also be accessed from toi.consts.TeiProfilerService.VAR_PROPERTY_GRAPHICS_MEMORY_PEAK.
VAR_PROPERTY_GRAPHICS_OPERATIONS (Type: string) (value = 'var.graphics.operations') (static, constant)

The number of hardware graphics operations performed by the application. Reset to zero at start of a profiling session TeiProfilerService#startProfiling. TeiProfilerService#getAverage returns the average number of graphics operations per second.

This constant can be also be accessed from toi.consts.TeiProfilerService.VAR_PROPERTY_GRAPHICS_OPERATIONS.
VAR_PROPERTY_GRAPHICS_SURFACES (Type: string) (value = 'var.graphics.surfaces') (static, constant)

The number of graphics surfaces allocated.

This constant can be also be accessed from toi.consts.TeiProfilerService.VAR_PROPERTY_GRAPHICS_SURFACES.
VAR_PROPERTY_GRAPHICS_SURFACES_PEAK (Type: string) (value = 'var.graphics.surfaces.peak') (static, constant)

The peak of the number of graphics surfaces allocated. Reset to zero at start of a profiling session TeiProfilerService#startProfiling.

This constant can be also be accessed from toi.consts.TeiProfilerService.VAR_PROPERTY_GRAPHICS_SURFACES_PEAK.
VAR_PROPERTY_SYSTEM_MEMORY (Type: string) (value = 'var.system.memory') (static, constant)

The amount of system memory (RAM) in use by the application in bytes.

This constant can be also be accessed from toi.consts.TeiProfilerService.VAR_PROPERTY_SYSTEM_MEMORY.
VAR_PROPERTY_SYSTEM_MEMORY_PEAK (Type: string) (value = 'var.system.memory.peak') (static, constant)

The peak on the amount of system memory (RAM) used by the application in bytes. Reset to zero at start of a profiling session TeiProfilerService#startProfiling.

This constant can be also be accessed from toi.consts.TeiProfilerService.VAR_PROPERTY_SYSTEM_MEMORY_PEAK.
TeiMeasurement (Type: struct) (static)

The measurement.

Struct fields

Name Description
property

The property.

Type: string
specifier

The specification of the threshold.

Type: TeiProfilerService.TeiThresholdSpecifier
threshold

The threshold, TeiProfilerService#subscribe.

Type: double
timeStamp

The timestamp at which the measurement was done in seconds. The timestamp is reset to zero at the start of the profiling session TeiProfilerService#startProfiling.

Type: double
type

The type of the measurement.

Type: TeiProfilerService.TeiMeasurementType
value

The value.

Type: double

5.1.p5

Copyright (c) 2017 ARRIS Enterprises, LLC. All Rights Reserved. ARRIS Enterprises, LLC. Confidential Information.