B WLDF Beans and Functions Reference

This appendix provides a reference for the beans and functions provided by WLDF that can be used in collected metrics policy expressions to obtain access to common WebLogic Server JMX data sources.

This appendix contains the following sections:

WLDF Beans Reference

WLDF provides the following beans that can be used in collected metrics policy expressions:

clusterRuntime

The clusterRuntime bean provides cluster-wide access to statistics for active clusters in the domain.

Attributes

Name Description
clusters

Provides a map of beans that represent active cluster objects within the domain, keyed by cluster name.

Type: interface java.util.Map

name

The name of the cluster.

Type: class java.lang.String

Methods

Name Description
query

Performs a query for a set of MBean attribute values based on an Object Name pattern and an attribute expression.

Parameters:

  • onPattern

    A valid JMX Object Name, or Object Name pattern.

  • attributePattern

    A EL expression that is used to retrieve a value from each matching MBean instance, where the expression is an attribute expression relative to each MBean.

    For example, if the MBean is the ServerRuntimeMBean, the expression 'OpenSocketsCurrentCount' obtains the value of the OpenSocketsCurrentCount attribute. By contrast, 'HealthState.State' obtains the State value of the HealthState child object.

Return values:

Returns a set of values matching the specified ObjectName pattern and attribute expression. These results can be fed to the wls:extract function for maintaining an in-memory history of values.

getClusters

Provides a map of beans that represent active cluster objects within the domain.

getAttribute

Obtains a single attribute value from an MBean source.

Parameters:

  • objectNamePattern

    A JMX ObjectName or ObjectName pattern that must resolve to a single MBean instance.

  • attribute

    The MBean attribute value to obtain.

Returns Values:

Returns the attribute value matching the specified JMX ObjectName.

domainRuntime

The domainRuntime bean provides access to MBeans registered in the Domain Runtime MBean Server.

Attributes

Name Description
domain

The root DomainRuntimeMBean in the Domain Runtime MBean Server.

name

The bean name.

Type: class java.lang.String

serverRuntimes

Returns the array of active ServerRuntimeMBean instances in the domain.

Type: class weblogic.management.runtime.ServerRuntimeMBean[]

Methods

Name Description
query

Performs a query for a set of MBean attribute values based on an Object Name pattern and an attribute expression.

Parameters:

  • onPattern

    A valid JMX Object Name, or Object Name pattern)

  • attributePattern

    A EL expression that is used to retrieve a value from each matching MBean instance, where the expression is an attribute expression relative to each MBean.

    For example, if the MBean is the ServerRuntimeMBean, the expression 'OpenSocketsCurrentCount' obtains the value of the OpenSocketsCurrentCount attribute. By contrast, 'HealthState.State' obtains the State value of the HealthState child object.

Return values:

Returns a set of values matching the specified Object Name pattern and attribute expression. These results can be fed to the wls:extract function for maintaining an in-memory history of values.

query

Executes a JMX query against a set of targets within the Domain Runtime MBean Server.

Parameters:

  • targets

    A list of server or cluster targets specified as a comma-delimited String

  • onPattern

    A valid JMX Object Name or Object Name pattern

  • expression

    A EL expression that is used to retrieve a value on each matching MBean instance

Return values:

Returns a set of values matching the specified Object Name pattern and attribute expression, across the specified target names.

The target names can be a valid WebLogic Server instance or cluster in the domain.

These results can be fed to the wls:extract function for maintaining an in-memory history of values.

lookupServerRuntime

Returns the ServerRuntimeMBean for the named server instance, or null if not specified.

Parameter:

  • serverName

    The name of the ServerRuntimeMBean to look up

Return values:

Returns a value matching the specified Object Name pattern and attribute expression.

getAttribute

Obtains a single attribute value from an MBean source.

Parameters:

  • objectNamePattern

    A JMX ObjectName or ObjectName pattern that must resolve to a single MBean instance.

  • attribute

    The MBean attribute value to obtain.

Returns Values:

Returns the attribute value matching the specified JMX ObjectName.

instrumentationEvent

The instrumentationEvent bean provides access to instrumentation event fields in instrumentation policy expressions.

Attributes

Name Description
timeStamp

The timestamp value associated with the event creation.

Type: class java.lang.Long

contextId

The diagnostic context ID associated with the instrumentation event.

Type: class java.lang.String

txId

The JTA transaction ID associated with the instrumentation event.

Type: class java.lang.String

userId

The user name associated with the request for which the instrumentation event is generated.

Type: class java.lang.String

eventType

The instrumentation event type.

Type: class java.lang.String

domain

The name of the current domain.

Type: class java.lang.String

server

The name of the server on which the instrumentation event occurred.

Type: class java.lang.String

scope

The instrumentation scope for this event.

Type: class java.lang.String

module

The name of the module in which the instrumentation event rule is defined.

Type: class java.lang.String

monitor

The instrumentation monitor that generated the instrumentation event.

Type: class java.lang.String

fileName

The source file name containing the code that generated the instrumentation event.

Type: class java.lang.String

lineNumber

The line number in the source file where the instrumentation event originated.

Type: class java.lang.Integer

className

The class name where the instrumentation event originated.

Type: class java.lang.String

methodName

The method name where the instrumentation event originated.

Type: class java.lang.String

methodDesc

The description of the method that generated the instrumentation event.

Type: class java.lang.String

arguments

The arguments passed into the method that generated the instrumentation event.

Type: class java.lang.String

returnValue

The return value for the method that generated the instrumentation event.

Type: class java.lang.String

payload

The payload associated with the instrumentation event.

Type class java.lang.Object

contextPayload

The context payload associated with the instrumentation event.

Type: class java.lang.String

dyeVector

The dye vector associated with the instrumentation event.

Type: class java.lang.Long

threadName

The name of the thread that generated the instrumentation event.

Type: class java.lang.String

partitionId

The partition ID associated with the instrumentation event.

Type: class java.lang.String

partitionName

The partition name associated with the instrumentation event.

Type: class java.lang.String

Example

The following are examples of using the instrumentationEvent bean in an EL policy expression to access instrumentation event fields:

instrumentationEvent.monitor == 'Servlet_Around_Service'
 
instrumentationEvent.getMonitor() == 'Servlet_Around_Service'
 
instrumentationEvent.monitor.contains('Servlet_')

log

Used in log policy expressions, the log bean provides access to log message fields.

Attributes

Name Description
timestamp

The timestamp indicating when the log message was created.

Type: class java.lang.Long

formattedDate

The formatted date string.

Type: class java.lang.String

messageId

The message ID of the log entry.

Type: class java.lang.String

machineName

The machine name on which the log entry was created.

Type: class java.lang.String

serverName

The server name on which the log entry was created.

Type: class java.lang.String

threadName

The thread name in which the logged event was created.

Type: class java.lang.String

userId

The ID of the user who generated the logged event.

Type: class java.lang.String

transactionId

The JTA transaction ID associated with the logged event.

Type: class java.lang.String

severity

The severity level for the log message.

Type: class java.lang.Integer

severityString

The severity string for the log message.

Type: class java.lang.String

subsystem

The name of the subsystem that generated the log message.

Type: class java.lang.String

logMessage

The message content of the log entry.

Type: class java.lang.String

diagnosticContextId

The diagnostic context ID associated with the logged event.

Type: class java.lang.String

supplementalAttributes

The name-value pairs of supplemental attributes that are included in the log entries.

Type: class java.util.Properties

partitionId

The partition ID associated with the logged event.

Type: class java.lang.String

partitionName

The partition ID associated with the logged event.

Type: class java.lang.String

Example

The following are examples of using the log bean in an EL policy expression to access log message fields:

log.logMessage.contains("Part of a message")
 
log.getLogMessage().contains("Part of a message")
 
log.messageId == "BEA-000365"
 
log.messageId.endsWith('000365')

partition

The partition bean is a convenience mechanism for obtaining partition scope metrics. This bean is available only to policies that are configured in a diagnostic system module that is deployed in the same partition to which this bean is scoped.

Attributes

Name Description
ID

The globally unique identifier associated with the named partition.

root

The PartitionMBean configuration root of the partition. Note that this is the read-only PartitionMBean that is registered in the WebLogic Server Runtime MBean Server.

Type: interface weblogic.management.configuration.PartitionMBean

runtime

The PartitionRuntimeMBean root of the partition in which the diagnostic system module is deployed.

Type: interface weblogic.management.runtime.PartitionRuntimeMBean

Methods

Name Description
query

Issues partition scoped JMX queries, filtered by the partition name.

Parameters:

  • onPattern

    A JMX Object Name or Object Name pattern

  • attributePattern

    EL expression for accessing a value within the set of MBeans returned in the query set

Return values:

Returns a set of values matching the specified object name pattern and attribute expression. These results can be fed to the wls:extract function for maintaining an in-memory history of values.

getAttribute

Obtains a single attribute value from an MBean source.

Parameters:

  • objectNamePattern

    A JMX ObjectName or ObjectName pattern that must resolve to a single MBean instance.

  • attribute

    The MBean attribute value to obtain.

Returns Values:

Returns the attribute value matching the specified JMX ObjectName.

platform

The platform bean obtain values from MBeans that are exposed through the JVM's platform MBean server. (Note that WebLogic Server uses the JVM's platform MBean server to contain the WebLogic run-time MBeans by default. As such, the platform MBean server provides access to platform MXBeans, WebLogic run-time MBeans, and WebLogic configuration MBeans that are on a single server instance.)

Attributes

Name Description
name

The name of the platform bean ("platform")

Methods

Name Description
query

Performs a query for a set of MBean attribute values based on an Object Name pattern and an attribute expression.

Parameters:

  • onPattern

    A valid JMX Object Name, or Object Name pattern)

  • attributePattern

    A EL expression that is used to retrieve a value from each matching MBean instance, where the expression is an attribute expression relative to each MBean.

    For example, if the MBean is the ServerRuntimeMBean, the expression 'OpenSocketsCurrentCount' obtains the value of the OpenSocketsCurrentCount attribute. By contrast, 'HealthState.State' obtains the State value of the HealthState child object.

Return values:

A set of values matching the specified Object Name pattern and attribute expression. These results can be fed to the wls:extract function for maintaining an in-memory history of values.

getAttribute

Obtains a single attribute value from an MBean source.

Parameters:

  • objectNamePattern

    A JMX ObjectName or ObjectName pattern that must resolve to a single MBean instance.

  • attribute

    The MBean attribute value to obtain.

Returns Values:

Returns the attribute value matching the specified JMX ObjectName.

resource

The resource bean provides access to beans and state information within a diagnostic system module deployment. Access is restricted to policies that are configured within the same diagnostic system module. That is, this bean cannot obtain access to beans and state information from policies that are configured in other diagnostic system modules. This bean is used for policy-chaining.

Attributes

Name Description
watches

A map of currently configured policies within the same diagnostic system module deployment.

Type: interface java.util.Map

runtime

The runtime bean provides access to MBeans registered in the WebLogic Server Runtime MBean Server.

Attributes

Name Description
domain

The root DomainMBean in the local WebLogic Server Runtime MBean Server.

Type: interface weblogic.management.configuration.DomainMBean

name

The bean name.

Type: class java.lang.String

serverRuntime

The root ServerRuntimeMBean in the local WebLogic Server Runtime MBean Server.

Type: interface weblogic.management.runtime.ServerRuntimeMBean

Methods

Name Description
query

Performs a query for a set of MBean attribute values based on an Object Name pattern and an attribute expression.

Parameters:

  • onPattern

    A valid JMX Object Name, or Object Name pattern)

  • attributePattern

    A EL expression that is used to retrieve a value from each matching MBean instance, where the expression is an attribute expression relative to each MBean.

    For example, if the MBean is the ServerRuntimeMBean, the expression 'OpenSocketsCurrentCount' obtains the value of the OpenSocketsCurrentCount attribute. By contrast, 'HealthState.State' obtains the State value of the HealthState child object.

Return values:

A set of values matching the specified Object Name pattern and attribute expression. These results can be fed to the wls:extract function for maintaining an in-memory history of values.

getAttribute

Obtains a single attribute value from an MBean source.

Parameters:

  • objectNamePattern

    A JMX ObjectName or ObjectName pattern that must resolve to a single MBean instance.

  • attribute

    The MBean attribute value to obtain.

Returns Values:

Returns the attribute value matching the specified JMX ObjectName.

Functions Reference

This section provides a reference for the set of functions that WLDF provides that can be used in policy expressions:

wls:tableChanges

The wls:tableChanges function takes a table of input values and generates an output table of difference vectors, one for each input vector.

This function throws an IllegalArgumentException if the input either:

  • Is not a two-dimensional table

  • Contains non-numeric values

Parameters

Name Description
inputTable

The input table of numeric values, where each row is typically a time series of values from the same metric instance.

wls:tableAverages

The wls:tableAverages function performs a matrix reduction on an input table of values, computing the average of each row in the table and producing a vector of averages, one for each row in the table. Typically each row in the table represents a time series of values from a particular metric instance.

This function throws an IllegalArgumentException if the input either:

  • Is not a two-dimensional table

  • Contains non-numeric values

Parameters

Name Description
valuesTable

The input table of numeric values, where each row is typically a time series of values from the same metric instance.

wls:extract

The wls:extract function extracts a table of time series from a specified set of input sources, based on a specified sampling rate schedule and time window. The input source can be one of the following:

  • The output from a query() operation from a JMX bean. For example:

    wls.runtime.query('com.bea:Type=ServletRuntime,*', 'ExecutionTimeAverage')
    
  • An EL expression, as a String. For example:

    wls.runtime.JVMRuntime.heapFreePercent
    

Parameters

Name Decription
inputExpression

The bean metric to be sampled.

schedule

The sampling rate of the metric, specified as a string, in hours, minutes, or seconds (the default).

duration

The required sampling window of the metric, specified as a string, in hours, minutes, or seconds (the default)

The schedule and duration parameters can be specified in seconds, minutes, or hours, and are specified as strings using the following syntax:

amount[unit]

In the preceding syntax:

  • amount represents an integer.

  • [unit] represents seconds, minutes, or hours. Each can be abbreviated to the first letter. For example: seconds can be abbreviated to s.

  • You may include a space character between amount and unit.

For example, any of the following can be used to specify five seconds:

  • 5seconds

  • 5 sec

  • 5s

  • 5snds

wls:average

The wls:average function computes an average value based on set of numeric input values. This function returns the scalar average of the input vector, or Double.NaN if the input is empty. If the input contains any non-numeric values, an IllegalArgumentException is thrown.

Note:

The wls:average function is different from the EL-provided average() operation.

Parameters

Name Description
inputValues

A vector of numeric input values

wls:changes

The wls:changes method takes a vector of input values of size n and produces a vector of (at most) n-1 differences between successive values. For example, if the input vector is { 3, 2, 5, 3, 7 }, the resulting vector is { 1, -1, 3, -2, 4 }.

Note the following:

  • It is possible for a sequence to contain Double.NaN, which are skipped in subsequent computations.

  • If an input value is non-numeric, an IllegalArgumentException is thrown.

Parameters

Name Description
inputValues

A input vector of numeric values

wls:aliveServersCount

The wls:aliveServersCount function is a helper function that counts the number of Managed Server instances that are in the RUNNING state in a given cluster.

Parameters

Name Description
clusterName

The name of the cluster containing the running server instances to be counted.