From 901d824972b5845c24459d2ec059ecf177d88b70 Mon Sep 17 00:00:00 2001 From: Vizay Soni Date: Tue, 13 Apr 2021 20:20:32 +0530 Subject: [PATCH 1/3] Make identifier field optional and put default value --- src/influxdb-reporter.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/influxdb-reporter.js b/src/influxdb-reporter.js index 0eaf2f4..55bf2fb 100644 --- a/src/influxdb-reporter.js +++ b/src/influxdb-reporter.js @@ -41,10 +41,9 @@ class InfluxDBReporter { this.context.measurement = this.reporterOptions.influxdbMeasurement || this.reporterOptions.measurement; this.context.username = this.reporterOptions.influxdbUsername || this.reporterOptions.username; this.context.password = this.reporterOptions.influxdbPassword || this.reporterOptions.password; - this.context.mode = this.reporterOptions.influxdbMode || this.reporterOptions.mode; - this.context.identifier = this.reporterOptions.influxdbIdentifier || this.reporterOptions.identifier; - this.context.debug = this.reporterOptions.influxdbDebug || this.reporterOptions.debug || false; - this.context.debug = this.context.debug === 'true'; + this.context.mode = this.reporterOptions.influxdbMode || this.reporterOptions.mode || 'http'; + this.context.identifier = this.reporterOptions.influxdbIdentifier || this.reporterOptions.identifier || `run-${Date.now()}`; + this.context.debug = (this.reporterOptions.influxdbDebug || this.reporterOptions.debug) == 'true'; if (!this.context.server) { throw new Error('[-] ERROR: InfluxDB Server Address is missing! Add --reporter-influxdb-server .'); @@ -63,9 +62,6 @@ class InfluxDBReporter { if (!this.context.measurement) { throw new Error('[-] ERROR: InfluxDB Measurement Name is missing! Add --reporter-influxdb-measurement .'); } - if (!this.context.mode) { - this.context.mode = 'http'; - } console.log(`[+] Starting collection: ${this.options.collection.name} ${this.context.id}`); const DataService = this.context.mode === 'udp' ? UdpService : HttpService; From 1a9c1db124ecf7d21258d2577d6ba2fdacb3e8bd Mon Sep 17 00:00:00 2001 From: Vizay Soni Date: Tue, 13 Apr 2021 20:24:21 +0530 Subject: [PATCH 2/3] Update README.md --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a25a9de..09fc13b 100644 --- a/README.md +++ b/README.md @@ -81,15 +81,16 @@ newman run https://www.getpostman.com/collections/631643-f695cab7-6878-eb55-7943 --- | --- `--reporter-influxdb-server` | IP Address or Host of InfluxDB `--reporter-influxdb-port` | Port no. (Usually `8086`) -`--reporter-influxdb-version` | InfluxDB Version (default `1`) +`--reporter-influxdb-version` | InfluxDB Version `1`, `2` (default `1`) `--reporter-influxdb-org` | InfluxDB Org (For InfluxDB version 2.x) `--reporter-influxdb-port` | Port no. (Usually `8086`) `--reporter-influxdb-name` | Database name (or Bucket name for InfluxDB version 2.x) `--reporter-influxdb-measurement` | Measurement Point name (If not provided, then reporter will create measurement with prefix `newman_results-`) `--reporter-influxdb-username` (*Optional*) | Username created for InfluxDB (e.g. `newman_user`) `--reporter-influxdb-password` (*Optional*) | Password of the user (e.g. `p@ssw0rd`) -`--reporter-influxdb-mode` | Transmission Mode `http`, `udp` (default: `http`) -`--reporter-debug` | Reporter debug mode (default: `false`) +`--reporter-influxdb-identifier` (*Optional*) | An identifier to be passed to InfluxDB (default: `run-${Date.now()}`) +`--reporter-influxdb-mode` | Transmission Mode `http`, `https`, `udp` (default: `http`) +`--reporter-debug` | Enable debug mode (default: `false`) --- @@ -111,6 +112,7 @@ v2.0.0+ | v1.8, v2.x - [x] Folder Structure - [x] Username and Password support - [x] Include UDP Reporter as well +- [x] HTTPS Support - [ ] Add batch operation - [ ] ESLint / StandardJS - [x] CI/CD with Github Actions @@ -203,4 +205,4 @@ docker run --name influxdb-1.7 -p 8086:8086 influxdb:1.7 docker run --name influxdb-1.8 -p 8086:8086 influxdb:1.8 docker run --name influxdb-2 -p 8086:8086 quay.io/influxdb/influxdb:v2.0.3 -``` \ No newline at end of file +``` From 52a5dbe25e018db10e612d2192f1a866cfab6244 Mon Sep 17 00:00:00 2001 From: Vizay Soni Date: Wed, 21 Apr 2021 01:28:43 +0530 Subject: [PATCH 3/3] Bump to version 2.0.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 22e2e4a..2796cc2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "newman-reporter-influxdb", - "version": "2.0.3", + "version": "2.0.4", "description": "Newman Reporter for InfluxDB", "main": "index.js", "scripts": {