Evaluate Metrics without provisioning

#1

Use evalMetricsWithMetaData to view the results of a new metric you want to build without the need to reprovision:

SmartBulb.evalMetricsWithMetadata({
  ids: ['smtbulb-1'],
  expressions: ["MyCompoundMetric"],
  start: "2017-10-16",
  end: "2017-10-20",
  interval: "DAY"
}, [
    CompoundMetric.make(
      {
        "id": "MyCompoundMetric",
        "name": "MyCompoundMetric",
        "expression": "SimpleMetric1 > SimpleMetric2 ? 1 : 0"
      }),
    SimpleMetric.make(
      {
         "id": "SimpleMetric1_SmartBulb",
         "name": "SimpleMetric1",
         "srcType": "SmartBulb",
         "expression": "sum(sum(normalized.data.quantity))" 
      })
  ]
).result['smtbulb-1'].MyCompoundMetric.data();
1 Like