(path, method = 'GET', token = 'report-token-1')
| 7 | const conf = require('../config.json'); |
| 8 | |
| 9 | async function query(path, method = 'GET', token = 'report-token-1') { |
| 10 | return new Promise(resolve => http.request({ |
| 11 | method, |
| 12 | host: conf.ipAddress, |
| 13 | path, |
| 14 | port: 8000, |
| 15 | headers: { 'x-scal-report-token': token }, |
| 16 | }, () => resolve()).end()); |
| 17 | } |
| 18 | |
| 19 | async function getMetrics() { |
| 20 | return new Promise(resolve => { |