metrics!!!!!!!!!!!
All checks were successful
Publish Docker Images / docker (push) Successful in 1m52s

This commit is contained in:
Lee
2023-11-16 17:52:44 +00:00
parent 6b08b8fc7a
commit 6003c2436a
12 changed files with 533 additions and 102 deletions

View File

@ -1,2 +1,3 @@
export * from "./envVariables";
export * from "./secrets";
export * from "./influx/influx";
export * from "./secrets/secrets";

View 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 };