STD.System.Workunit.WorkunitStatistics ( wuid [, includeActivities ] [, _filter ])
| wuid | A null-terminated string containing the WorkUnit IDentifier. |
| includeActivities | Optional. A Boolean TRUE or FALSE flag specifying whether activity-level statistics are included. If omitted, the default is FALSE. |
| _filter | Optional. A null-terminated string containing a statistics filter expression. If omitted, the default is an empty string. |
| Return: | WorkunitStatistics returns a DATASET value. |
The WorkunitStatistics function returns a DATASET with this format:
EXPORT WsStatistic := RECORD UNSIGNED8 value; UNSIGNED8 count; UNSIGNED8 maxValue; STRING creatorType; STRING creator; STRING scopeType; STRING scope; STRING name; STRING description; STRING unit; END;
Each record in the returned dataset specifies a statistic for the workunit.
The optional _filter parameter is a comma-separated
list of option[value] clauses that can be used to limit
which scopes are searched and which statistics are returned.
The supported filter clauses are:
scope[<scope-id>],
stype[<scope-type>], or
id[<id>] to select matching scopes. These
clauses may be repeated, but scope,
stype, and id should not be mixed
in the same filter.
depth[n], depth[low,high],
or depth[low..high] to restrict the depth searched
for matches.
source[global|stats|statistics|graph|workflow|exception|all]
to choose which workunit sources are searched.
where[<stat>],
where[<stat>(=|<|<=|>|>=)<value>],
or where[<stat>=<low>..<high>] to
filter by statistic existence or value range.
matched[true|false],
nested[<depth>|all], and
include[<scope-type>] or
includetype[<scope-type>] to control which
matching scopes are returned.
properties[statistics|hints|attributes|notes|scope|all]
or props[...] to choose categories of properties to
return.
statistic[<statistic-kind>|none|all] or
stat[...],
attribute[<attribute-name>|none|all] or
attr[...],
hint[<hint-name>],
property[<name>] or
prop[...],
measure[<measure>], and
version[<version>] to control which details are
returned for each scope.
Common scope type values include global,
graph, subgraph,
activity, operation,
workflow, file, and
child. Statistic names use the internal statistic kind
names, for example TimeElapsed and
NumRowsProcessed.
Example:
OUTPUT(STD.System.Workunit.WorkunitStatistics('W20260330-164946'));
OUTPUT(STD.System.Workunit.WorkunitStatistics('W20260330-164946', TRUE));
OUTPUT(STD.System.Workunit.WorkunitStatistics('W20260330-164946', FALSE,
'source[stats],where[TimeElapsed>1000000]'));
OUTPUT(STD.System.Workunit.WorkunitStatistics('W20260330-164946', TRUE,
'stype[activity],where[NumRowsProcessed>0],stat[NumRowsProcessed],
stat[TimeElapsed]'));