Defining Custom Views

A powerful feature of LivePerf is the ability to define custom charts and tables based on multiple counters. As described below, defining a custom view has two parts: specifying data to plot through a Query and specifying rendering options (specific to each control).

Identifiers

It is important to note that names of entities and counters as displayed on screen are human-readable, localised names. These names don't always match the real identifier used underneath by the application, and which must be used when defining custom views. To reveal these identifiers select 'Toggle Identifiers' on the View menu.

Queries

The Query object is the part of the View definition that specifies what data needs to be collected and processed before being displayed. Resources and Functions (see below) are defined together inside a Query. Syntax:

    <query>
        <resource id="" rid=""/>
        ...
        <function op="" id="">
            <param id=""/>
        <function>
        ...
    </query>
		

Multiple <resource> and <function> tags can be specified. As described below, Functions act as virtual counters and generate values based on Resources defined in the same Query.

Views

Along with a Query to provide data, control-specific rendering options must be provided, to specify how data should be displayed on screen.

Plotting a view always results in a control being created, and depending on the chosen control different options are available. See "Controls" for details.

Resources

In LivePerf's terminology a Resource is a fully specified entity or counter. A resource's syntax contains up to four parts separated by '/':

<host>/<agent>/<entity>/[<counter>]

Note that the counter part is always enclosed in square brackets; this is to unambiguosly separate it from the entity part. Here's an example:

localhost/windows/root/LogicalDisk/C:/[Disk Writes/sec]

The above resource identifies the 'Disk Writes/sec' counter of the 'LogicalDisk/C:' entity of the 'Windows' agent on machine 'localhost'.

Relative resource paths can also be used. Views can be created at different levels (host, agent or entity level) in the monitoring session tree. All views are aware of their location, and if host or agent names are not specified, the current values will be used. Rewriting the above example:

-/-/root/LogicalDisk/C:/[Disk Writes/sec]

Assuming this resource was saved under an entity of the Windows agent, when plotted it will dynamically complete the path with the real names of the host and agent it was plotted from. This allows the same query to be reused on different hosts, or on different agent instances.

This is the XML syntax for specifying a resource:

<resource id="" rid="" name="" description="" iname="" format="" type=""/>
  • id(mandatory): a short unique id to be used as reference in the same query (see below).
  • rid(mandatory): resource identifier as described above.
  • name(optional): text to be displayed as the name of this resource.
  • description(optional): descriptive text for this resource.
  • iname(optional): instance name (see regular expressions below) designed to have different values for each entity matched by a regular expression.
  • type(optional): can be one of 'string', 'number' or 'date'. Used to determine data type for the value returned and to choose the appropriate rendering. If not specified will default to 'number'.
  • format(optional): format specifier used when displaying values provided by this resource (see "Formatting Syntax").
  • code(optional): Java code (body of a Java function) to be executed with this resource as an input parameter. This is a shorthand for creating a <function op="script"> tag (see "op="script"").

Both 'name' and 'iname' accept a series of tags which will be replaced at runtime with actual values. More information can be found under "Resource Name Tags".

Regular Expressions

Each of the four components of a resource can be also specified as a regular expression (see "Regular Expression Syntax"). To indicate that a resource component is to be treated as a regular expression, rather than a fixed string, enclose it in brackets. Example:

localhost/windows/root/LogicalDisk/(.*)/[Disk Writes/sec]

Note that a part of the entity component is enclosed in brackets, which means it is to be treated as a regular expression. This above example identifies all [Disk Writes/sec] counters for all logical disks on localhost.

Functions

Values returned by resources can be further processed by using Functions. A function can use the input of more Resources and will produce a value as result. This is the syntax for defining a function:

    <function op="" id="" name="" description="" iname="" format="" type="">
        <param id=""/>
        <param id=""/>
        ...
    </function>
		
  • id(mandatory): a short unique id to be used as reference in the same query (see below).
  • op(mandatory): the operation this function performs (see "Functions").
  • name,description,iname,format,type(optional): same as Resource's attributes described above. If not specified the function will inherit them from the resources it uses.
  • param(optional): if the function requires parameters a <param> tag must be used for each one, and the id attribute must specify one of the resources defined in the same query. Multiple <param> tags are allowed.

See "Functions" for a list of functions supported by this version of LivePerf.

View Editor

New views can be created with the use of the View Editor. To access this editor select View tab of an entity, right click and choose 'Add' from the context menu.

View Editor

Figure 15. View Editor

Dashboard Editor

For easy access to a full system overview, multiple views can be grouped and plotted together. To bring up this editor, select the Dashboards tab of an entity, right-click and choose 'Add'.

Dashboard Editor

Figure 16. Dashboard Editor

The left panel shows the same monitoring session tree and the right one shows views for the selected entity. These views can be added to the bottom panel which shows the contents of the dashboard.