No known key found for this signature in database
GPG Key ID: 86A4D290ED03FAB4
2 changed files with
4 additions and
3 deletions
-
client/src/class/ClientService.ts
-
server/src/class/Database.ts
|
|
@ -13,12 +13,12 @@ export class ClientService { |
|
|
|
tempService(): void { |
|
|
|
setInterval(() => { |
|
|
|
this.clientSocket.sendTemp(this.sensor.takeMeasure, 'temperature'); |
|
|
|
}, 1 * 60000); |
|
|
|
}, 5 * 60000); |
|
|
|
} |
|
|
|
|
|
|
|
tempTestService(): void { |
|
|
|
setInterval(() => { |
|
|
|
this.clientSocket.sendTemp(this.sensor.takeTestMeasure, 'temperature'); |
|
|
|
}, 1 * 60000); |
|
|
|
}, 5 * 60000); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
@ -49,7 +49,8 @@ export class Database { |
|
|
|
} |
|
|
|
|
|
|
|
query(filter: string, timeFrame: string) { |
|
|
|
const query = `from(bucket: "${process.env.DB_BUCKET}") |> range(start: -${timeFrame}) |> filter(fn: (r) => r._measurement == "${filter}")`; |
|
|
|
const query = `from(bucket: "${process.env.DB_BUCKET}") |> range(start: -${timeFrame}) |> group(columns: ["client"])
|
|
|
|
|> filter(fn: (r) => r._measurement == "${filter}")`;
|
|
|
|
|
|
|
|
const data = this.queryApi |
|
|
|
.collectRows(query) |
|
|
|