Testing Metrics in Console

#1

Hi All,

In training we were shown a method for testing a Metric and or Analytic in the static console.
Can someone create an explanation or provide examples for evaluating metrics within the console prior to provisioning would be very helpful thanks!

0 Likes

#2

You need to use MyType.evalMetricsWithMetadata. First argument is the spec as per regular metrics evaluation, but second argument can be a list of custom metrics (both simple and compound).

For instance:

var customMetric = CompoundMetric.make({
    id: "CMTest",
    name: "CMTest",
    expression:  " DayOfWeek == 2 "
});


var results = MyType.evalMetricsWithMetadata({
    ids:["id1"],
    expressions: ["CMTest"],
    start: "2017-08-20T02:00:00",
    end: "2017-08-30T07:00:00",
    interval: "DAY"
}, [customMetric]);
0 Likes