1
0
mirror of https://github.com/yldio/copilot.git synced 2024-12-01 07:30:07 +02:00

feat(portal-api): ignore metrics for stopped instances

This commit is contained in:
Sérgio Ramos 2017-08-30 11:56:42 +01:00
parent 827379806b
commit 666a9ad1e8

View File

@ -2005,6 +2005,10 @@ class Data extends EventEmitter {
getMetricsForInstance (instance) { getMetricsForInstance (instance) {
return ({ names, start, end }) => { return ({ names, start, end }) => {
if (instance.status.toUpperCase() !== 'RUNNING') {
return Promise.resolve([]);
}
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const options = { const options = {
deploymentGroupId: instance.deployment_group_id, deploymentGroupId: instance.deployment_group_id,