Browse Source

not using influxdb

main
piercingl1ght 1 year ago
parent
commit
5492501256
  1. 16
      searching-front/services/modules/influxdb/index.ts

16
searching-front/services/modules/influxdb/index.ts

@ -25,7 +25,8 @@ class InfluxDb {
return writeApi return writeApi
} }
writeSitesCount({ all, available }: WriteSitesCounteParams) { writeSitesCount({ all, available }: WriteSitesCounteParams) {
const writeApi = this.getWriteApi() return
/*const writeApi = this.getWriteApi()
const pointAll = new Point(influxPointName).intField(InfluxField.ALL_SITES, all) const pointAll = new Point(influxPointName).intField(InfluxField.ALL_SITES, all)
const pointAvailable = new Point(influxPointName).intField( const pointAvailable = new Point(influxPointName).intField(
InfluxField.AVAILABLE_SITES, InfluxField.AVAILABLE_SITES,
@ -33,18 +34,21 @@ class InfluxDb {
) )
writeApi.writePoint(pointAll) writeApi.writePoint(pointAll)
writeApi.writePoint(pointAvailable) writeApi.writePoint(pointAvailable)
writeApi.close() writeApi.close() */
} }
async query({ field, period }: QueryParams) { async query({ field, period }: QueryParams) {
const queryApi = this.client.getQueryApi(influxOrg) return []
/* const queryApi = this.client.getQueryApi(influxOrg)
const query = influxQuery(field, period) const query = influxQuery(field, period)
const result = await queryApi.collectRows(query) const result = await queryApi.collectRows(query)
return processInfluxResult(result); return processInfluxResult(result); */
} }
async getHistoryOfState(period: InfluxPeriod) { async getHistoryOfState(period: InfluxPeriod) {
const all = await this.query({ return { all: [], available: [] }
/* const all = await this.query({
field: InfluxField.ALL_SITES, field: InfluxField.ALL_SITES,
period, period,
}) })
@ -57,7 +61,7 @@ class InfluxDb {
return { return {
all, all,
available, available,
} } */
} }
} }

Loading…
Cancel
Save