A RefreshMetricsTask error after updating a metric path

#1

Hello!

I updated the path of an existing simple metric (GaskPCSCoeff) affected to the type BillingAccount.

After provisionning the updated package, and trying to execute the refreshMetrics function on the type, i face a RefreshMetricsTask error saying: No metric named ‘GaskPCSCoeff’ found with src type ‘BillingAccount’.

I checked the metrics list (using BillingAccount.listMetrics() ) :

image

The metric is in the type list…

Thanks for your help and ideas,
HEDI

#2

refreshMetrics is for refreshing cached metrics, I believe you need to provide a spec with objs/start/end/etc.
Is your metric cached? if not then you don’t need to call refreshMetrics.

Did you try to manually run an evalMetric on GaskPCSCoeff? what’s the ouptput or error?

1 Like
#3

I resolved this problem, the metric file was duplicated…

But, now i’m facing the same issue with a compund metric: GasInKWhMonthly (check the pic above). It’s in the type metrics list but it’s not recognised when excuting this:

BillingAccount.evalMetrics({
 expressions:['GasInKWhMonthly'],
 ids: ["513371268"],
 start:'2018-10-19T23:00:00.000',
 end:'2018-12-30T00:00:00.000',
 interval:'MONTH',
 include: 'dates'
})
#4

the above GasInKWhMonthly (in listMetrics) is a simple metric, when you do evalMetric the engine will first look for a compound metric with same name. So I guess you’ve a second metric GasInKWhMonthly which is a compound one.

Can you post the expression of this compound one, may be it;s calling anohter metric that you didn’t define for BillingAccount. also can you share the error message of your above evalMetrics.

1 Like
#5

So,

How did you knew that GasInKWhMonthly is a simple metric?, i defined it just once as a compound one:

{
“id”: “GasInKWhMonthly_BillingAccount”,
“name”: “GasInKWhMonthly”,
“expression”: “GaskPCSCoeff*NaturalGasConsumptionMonthTotal”
}

For GaskPCSCoeff :

{
“id” : “GaskPCSCoeff_BillingAccount”,
“name” : “GaskPCSCoeff”,
“srcType” : “BillingAccount”,
“description” :"",
“expression” : “avg(avg(normalized.data.kPCS))”,
“path” : “serviceAgreements.servicePoints.detailedBills.(measurementType==‘GasAmount’ && measurementCategory == ‘Amount’ && rateType ==‘CO’)”
}

For NaturalGasConsumptionMonthTotal :

{
“id” : “NaturalGasConsumptionMonthTotal_BillingAccount”,
“name” : “NaturalGasConsumptionMonthTotal”,
“srcType” : “BillingAccount”,
“expression” : “sum(sum(normalized.data.quantity))”,
“path” : “serviceAgreements.servicePoints.measurements.(resource.id == ‘naturalgas’ && measurementType == ‘GasConsumption’ && remote == true && measurementCategory ==‘MonthlyConsumption’)”
}

I noticed that NaturalGasConsumptionMonthTotal is missing in the metrics list… which is not normal…

The error message:

message: “MetricEngine error : ↵Metric with name ‘GasInKWhMonthly’ for type ‘BillingAccount’ not found! Check seed data!”

#6

can you rename GasInKWhMonthly_BillingAccount to just GasInKWhMonthly, this should fix the issue.

1 Like
#7

Yes! That fixed the issue, Thnx