|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
import { queryByMetric, Datasource, Metric } from 'grafana-datasource-kit'; |
|
|
|
|
import { apiKeys } from './config'; |
|
|
|
|
|
|
|
|
|
import { queryByMetric, Datasource, Metric } from '@corpglory/tsdb-kit'; |
|
|
|
|
|
|
|
|
|
import * as csv from 'fast-csv'; |
|
|
|
|
import * as path from 'path'; |
|
|
|
|
import * as fs from 'fs'; |
|
|
|
@ -29,7 +30,6 @@ export class Target {
|
|
|
|
|
this.metric = new Metric(datasource, targets); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public updateStatus(status) { |
|
|
|
|
let time = moment().valueOf(); |
|
|
|
|
let data = { |
|
|
|
@ -87,7 +87,8 @@ export class Target {
|
|
|
|
|
} |
|
|
|
|
this.csvStream.end(); |
|
|
|
|
} |
|
|
|
|
// TODO: move csv-related stuff to service
|
|
|
|
|
|
|
|
|
|
// TODO: move csv-related stuff to a service
|
|
|
|
|
private initCsvStream() { |
|
|
|
|
this.csvStream = csv.createWriteStream({ headers: true }); |
|
|
|
|
let writableStream = fs.createWriteStream(this.getFilePath('csv')); |
|
|
|
|