sitespeed.io 36.4.0 → 37.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,26 +0,0 @@
1
- import { InfluxDB } from 'influx';
2
-
3
- export class InfluxDBSender {
4
- constructor({ protocol, host, port, database, username, password }) {
5
- this.client = new InfluxDB({
6
- protocol,
7
- host,
8
- port,
9
- database,
10
- username,
11
- password
12
- });
13
- }
14
-
15
- send(data) {
16
- const points = [];
17
- for (let point of data) {
18
- points.push({
19
- tags: point.tags,
20
- measurement: point.seriesName,
21
- fields: point.point
22
- });
23
- }
24
- return this.client.writePoints(points);
25
- }
26
- }
@@ -1,38 +0,0 @@
1
- import { InfluxDB, Point, HttpError } from '@influxdata/influxdb-client';
2
-
3
- export class InfluxDB2Sender {
4
- constructor({ protocol, host, port, database, organisation, token }) {
5
- this.client = new InfluxDB({
6
- url: `${protocol}://${host}:${port}`,
7
- token
8
- }).getWriteApi(organisation, database);
9
- this.database = database;
10
- }
11
-
12
- send(data) {
13
- const points = [];
14
- for (let point of data) {
15
- const influxPoint = new Point(point.seriesName);
16
- for (const key of Object.keys(point.tags)) {
17
- influxPoint.tag(key, point.tags[key]);
18
- }
19
- for (const key of Object.keys(point.point)) {
20
- if (key === 'time') {
21
- influxPoint.timestamp(new Date(point.point[key]));
22
- } else {
23
- influxPoint.floatField(key, point.point[key]);
24
- }
25
- }
26
- points.push(influxPoint);
27
- }
28
- this.client.writePoints(points);
29
- return this.client.flush().catch(error => {
30
- if (error instanceof HttpError && error.statusCode === 401) {
31
- throw new Error(
32
- `The InfluxDB database: ${this.database} doesn't exist.`
33
- );
34
- }
35
- throw new Error('Writing to influx failed');
36
- });
37
- }
38
- }
@@ -1,21 +0,0 @@
1
- version: '2'
2
- services:
3
- grafana:
4
- image: grafana/grafana
5
- depends_on:
6
- - influxdb
7
- links:
8
- - influxdb
9
- ports:
10
- - "3000:3000"
11
- influxdb:
12
- image: tutum/influxdb
13
- environment:
14
- - PRE_CREATE_DB="sitespeed"
15
- - ADMIN_USER="root"
16
- - INFLUXDB_INIT_PWD="root"
17
- ports:
18
- - "8083:8083"
19
- - "8086:8086"
20
- - "8090:8090"
21
- - "8099:8099"