metrics!!!!!!!!!!!
All checks were successful
Publish Docker Images / docker (push) Successful in 1m52s
All checks were successful
Publish Docker Images / docker (push) Successful in 1m52s
This commit is contained in:
@ -1,2 +1,3 @@
|
||||
export * from "./envVariables";
|
||||
export * from "./secrets";
|
||||
export * from "./influx/influx";
|
||||
export * from "./secrets/secrets";
|
||||
|
29
packages/utils/src/influx/influx.ts
Normal file
29
packages/utils/src/influx/influx.ts
Normal file
@ -0,0 +1,29 @@
|
||||
import { InfluxDB } from "@influxdata/influxdb-client";
|
||||
|
||||
/**
|
||||
* Creates an InfluxDB client
|
||||
*
|
||||
* @param token the influx token
|
||||
* @param url the url of the influx instance
|
||||
* @param org the org of the influx instance
|
||||
* @param bucket the bucket of the influx instance
|
||||
* @returns
|
||||
*/
|
||||
function createInfluxClient(
|
||||
token: string,
|
||||
url: string,
|
||||
org: string,
|
||||
bucket: string
|
||||
) {
|
||||
const client = new InfluxDB({
|
||||
url: url,
|
||||
token: token,
|
||||
});
|
||||
|
||||
return {
|
||||
influxWriteClient: client.getWriteApi(org, bucket, "ms"),
|
||||
influxQueryClient: client.getQueryApi(org),
|
||||
};
|
||||
}
|
||||
|
||||
export { createInfluxClient };
|
Reference in New Issue
Block a user