WorkunitStatistics

STD.System.Workunit.WorkunitStatistics ( wuid [, includeActivities ] [, _filter ])

wuidA null-terminated string containing the WorkUnit IDentifier.
includeActivitiesOptional. A Boolean TRUE or FALSE flag specifying whether activity-level statistics are included. If omitted, the default is FALSE.
_filterOptional. 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:

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]'));