qie.addTimeToChannelStats(metricId, description, time) is a QIE method that adds a custom timing metric to the channel statistics display. It reports the metric in the channel’s overall stats view, and the value is treated as a time in milliseconds. The documented parameters are:
metricId (Integer): custom metric ID; QIE reports it as 9000 + metricId to avoid conflicts with channel node IDs
description (String): label shown for the metric
time (Long): elapsed time in milliseconds
For it to appear, channel stats must be enabled in the source node’s Advanced Options, and you can view the stats from the channel using View -> Stats menu in the to right corner of a channel
Example Code:
var start = qie.getSystemTimeMilliseconds();
// do some heavy logic you're interested in timing.
var pQuery = qie.getParameterizedQuery("SELECT firstName, lastName, dateofbirth FROM person WHERE patientID = :pid");
pQuery.setString("pid", source.getNode("PID-2"));
var queryResult = pQuery.doQuery(
"dbConnectionName",
false,
false
);
message.setNode("PID-5.2", queryResult.getNode("firstName"));
message.setNode("PID-5.1", queryResult.getNode("lastName"));
var end = qie.getSystemTimeMilliseconds();
qie.addTimeToChannelStats (2, 'processTime', end - start);