From 9cecb1d89905123c11295553392aedceeff55977 Mon Sep 17 00:00:00 2001 From: Gong Deli Date: Tue, 30 Jun 2020 18:43:07 +0800 Subject: [PATCH] Force use local report when prometheus monitor is used (#1) * use local report result * add a workaround to Dockerfile * v0.3.2-advanca.1 --- lerna.json | 14 +++++++----- packages/caliper-burrow/package.json | 12 +++++----- packages/caliper-cli/package.json | 22 +++++++++---------- .../orchestrators/round-orchestrator.js | 17 ++++++++------ packages/caliper-core/package.json | 18 +++++++-------- packages/caliper-ethereum/package.json | 10 ++++----- packages/caliper-fabric/package.json | 14 ++++++------ packages/caliper-fisco-bcos/package.json | 10 ++++----- packages/caliper-gui-dashboard/package.json | 4 ++-- packages/caliper-gui-server/package.json | 14 ++++++------ packages/caliper-iroha/package.json | 12 +++++----- packages/caliper-publish/caliper.Dockerfile | 3 +++ packages/caliper-publish/package.json | 10 ++++----- packages/caliper-sawtooth/package.json | 16 +++++++------- .../caliper-tests-integration/package.json | 20 ++++++++--------- packages/generator-caliper/package.json | 20 ++++++++--------- 16 files changed, 112 insertions(+), 104 deletions(-) diff --git a/lerna.json b/lerna.json index d9212b896..c8f148207 100644 --- a/lerna.json +++ b/lerna.json @@ -1,11 +1,13 @@ { "command": { "bootstrap": { - "npmClientArgs": ["--no-package-lock"] + "npmClientArgs": [ + "--no-package-lock" + ] } }, - "packages": [ - "packages/caliper-core", + "packages": [ + "packages/caliper-core", "packages/caliper-burrow", "packages/caliper-ethereum", "packages/caliper-fabric", @@ -19,6 +21,6 @@ "packages/caliper-gui-server", "packages/generator-caliper" ], - "version": "0.3.2", - "hoist": true - } + "version": "0.3.2-advanca.1", + "hoist": true +} diff --git a/packages/caliper-burrow/package.json b/packages/caliper-burrow/package.json index 75d6cae86..c0ec678f8 100644 --- a/packages/caliper-burrow/package.json +++ b/packages/caliper-burrow/package.json @@ -1,7 +1,7 @@ { "name": "@hyperledger/caliper-burrow", "description": "Hyperledger Burrow adaptor for Caliper, enabling the running of performance benchmarks that interact with Burrow", - "version": "0.3.2", + "version": "0.3.2-advanca.1", "repository": { "type": "git", "url": "https://github.com/hyperledger/caliper", @@ -22,19 +22,19 @@ "npm": ">=5.6.0" }, "dependencies": { - "@hyperledger/caliper-core": "0.3.2", + "@hyperledger/caliper-core": "^0.3.2-advanca.1", "google-protobuf": "^3.11.4" }, "devDependencies": { "@hyperledger/burrow": "0.30.2", - "google-protobuf": "^3.11.4", "chai": "^3.5.0", "eslint": "^5.16.0", + "google-protobuf": "^3.11.4", + "license-check-and-add": "2.3.6", "mocha": "3.4.2", "nyc": "11.1.0", "rewire": "^4.0.0", - "sinon": "^7.3.2", - "license-check-and-add": "2.3.6" + "sinon": "^7.3.2" }, "license-check-and-add-config": { "folder": ".", @@ -87,4 +87,4 @@ "lines": 5 }, "license": "Apache-2.0" -} \ No newline at end of file +} diff --git a/packages/caliper-cli/package.json b/packages/caliper-cli/package.json index 92305e3f8..92a83ab22 100644 --- a/packages/caliper-cli/package.json +++ b/packages/caliper-cli/package.json @@ -1,7 +1,7 @@ { "name": "@hyperledger/caliper-cli", "description": "Hyperledger Caliper CLI, for convenience running of a performance benchmark to test blockchain technologies", - "version": "0.3.2", + "version": "0.3.2-advanca.1", "repository": { "type": "git", "url": "https://github.com/hyperledger/caliper", @@ -26,23 +26,23 @@ "npm": ">=5.6.0" }, "dependencies": { - "@hyperledger/caliper-core": "0.3.2", - "@hyperledger/caliper-burrow": "0.3.2", - "@hyperledger/caliper-fabric": "0.3.2", - "@hyperledger/caliper-iroha": "0.3.2", - "@hyperledger/caliper-sawtooth": "0.3.2", - "@hyperledger/caliper-ethereum": "0.3.2", - "@hyperledger/caliper-fisco-bcos": "0.3.2", + "@hyperledger/caliper-burrow": "^0.3.2-advanca.1", + "@hyperledger/caliper-core": "^0.3.2-advanca.1", + "@hyperledger/caliper-ethereum": "^0.3.2-advanca.1", + "@hyperledger/caliper-fabric": "^0.3.2-advanca.1", + "@hyperledger/caliper-fisco-bcos": "^0.3.2-advanca.1", + "@hyperledger/caliper-iroha": "^0.3.2-advanca.1", + "@hyperledger/caliper-sawtooth": "^0.3.2-advanca.1", "yargs": "15.3.1" }, "devDependencies": { "chai": "^3.5.0", "eslint": "^5.16.0", + "license-check-and-add": "2.3.6", "mocha": "3.4.2", "nyc": "11.1.0", "rewire": "^4.0.0", - "sinon": "^7.3.2", - "license-check-and-add": "2.3.6" + "sinon": "^7.3.2" }, "license-check-and-add-config": { "folder": ".", @@ -95,4 +95,4 @@ "lines": 5 }, "license": "Apache-2.0" -} \ No newline at end of file +} diff --git a/packages/caliper-core/lib/master/orchestrators/round-orchestrator.js b/packages/caliper-core/lib/master/orchestrators/round-orchestrator.js index 0aa6ad263..5fb5c9c80 100644 --- a/packages/caliper-core/lib/master/orchestrators/round-orchestrator.js +++ b/packages/caliper-core/lib/master/orchestrators/round-orchestrator.js @@ -190,12 +190,15 @@ class RoundOrchestrator { // Build the report // - TPS - let idx; - if (this.monitorOrchestrator.hasMonitor('prometheus')) { - idx = await this.report.processPrometheusTPSResults({start, end}, roundConfig, index); - } else { - idx = await this.report.processLocalTPSResults(results, roundConfig); - } + // FIXME(advanca): directly use local tps results as the prometheus monitor result is inaccurate + // See https://github.com/hyperledger/caliper/issues/826 + let idx = await this.report.processLocalTPSResults(results, roundConfig); + + // if (this.monitorOrchestrator.hasMonitor('prometheus')) { + // idx = await this.report.processPrometheusTPSResults({start, end}, roundConfig, index); + // } else { + // idx = await this.report.processLocalTPSResults(results, roundConfig); + // } // - Resource utilization await this.report.buildRoundResourceStatistics(idx, roundConfig.label); @@ -210,7 +213,7 @@ class RoundOrchestrator { await this.monitorOrchestrator.restartAllMonitors(); } } catch (err) { - await this.testObserver.stopWatch(); + // await this.testObserver.stopWatch(); failed++; logger.error(`Failed round ${index + 1} (${roundConfig.label}): ${err.stack || err}`); } diff --git a/packages/caliper-core/package.json b/packages/caliper-core/package.json index 651012bba..8f360395e 100644 --- a/packages/caliper-core/package.json +++ b/packages/caliper-core/package.json @@ -1,7 +1,7 @@ { "name": "@hyperledger/caliper-core", "description": "Core Hyperledger Caliper module, used for running performance benchmarks that interact with blockchain technologies", - "version": "0.3.2", + "version": "0.3.2-advanca.1", "repository": { "type": "git", "url": "https://github.com/hyperledger/caliper", @@ -23,12 +23,14 @@ }, "dependencies": { "color-scheme": "^1.0.1", + "colors": "^1.4.0", "compare-versions": "^3.4.0", "dockerode": "3.1.0", "fs-extra": "8.1.0", "js-yaml": "^3.13.1", - "mustache": "^2.3.0", + "logform": "^2.1.2", "mqtt": "3.0.0", + "mustache": "^2.3.0", "nconf": "^0.10.0", "nconf-yaml": "^1.0.2", "pidusage": "^1.1.6", @@ -36,20 +38,18 @@ "request": "^2.81.0", "systeminformation": "^3.23.7", "table": "^4.0.1", - "winston": "^3.2.1", - "winston-daily-rotate-file": "^4.2.1", "triple-beam": "^1.3.0", - "logform": "^2.1.2", - "colors": "^1.4.0" + "winston": "^3.2.1", + "winston-daily-rotate-file": "^4.2.1" }, "devDependencies": { "chai": "^3.5.0", "eslint": "^5.16.0", + "license-check-and-add": "2.3.6", "mocha": "3.4.2", "nyc": "11.1.0", "rewire": "^4.0.0", - "sinon": "^7.3.2", - "license-check-and-add": "2.3.6" + "sinon": "^7.3.2" }, "license-check-and-add-config": { "folder": ".", @@ -108,4 +108,4 @@ "lines": 1 }, "license": "Apache-2.0" -} \ No newline at end of file +} diff --git a/packages/caliper-ethereum/package.json b/packages/caliper-ethereum/package.json index 23706b6f3..e5f174602 100644 --- a/packages/caliper-ethereum/package.json +++ b/packages/caliper-ethereum/package.json @@ -1,7 +1,7 @@ { "name": "@hyperledger/caliper-ethereum", "description": "Ethereum adaptor for Caliper, enabling the running of performance benchmarks that interact with Ethereum", - "version": "0.3.2", + "version": "0.3.2-advanca.1", "repository": { "type": "git", "url": "https://github.com/hyperledger/caliper", @@ -22,18 +22,18 @@ "npm": ">=5.6.0" }, "dependencies": { - "@hyperledger/caliper-core": "0.3.2", + "@hyperledger/caliper-core": "^0.3.2-advanca.1", "ethereumjs-wallet": "^0.6.3" }, "devDependencies": { - "web3": "1.2.2", "chai": "^3.5.0", "eslint": "^5.16.0", + "license-check-and-add": "2.3.6", "mocha": "3.4.2", "nyc": "11.1.0", "rewire": "^4.0.0", "sinon": "^7.3.2", - "license-check-and-add": "2.3.6" + "web3": "1.2.2" }, "license-check-and-add-config": { "folder": ".", @@ -86,4 +86,4 @@ "lines": 5 }, "license": "Apache-2.0" -} \ No newline at end of file +} diff --git a/packages/caliper-fabric/package.json b/packages/caliper-fabric/package.json index a4d215000..b556cfe83 100644 --- a/packages/caliper-fabric/package.json +++ b/packages/caliper-fabric/package.json @@ -1,7 +1,7 @@ { "name": "@hyperledger/caliper-fabric", "description": "Hyperledger Fabric adaptor for Caliper, enabling the running of performance benchmarks that interact with Fabric", - "version": "0.3.2", + "version": "0.3.2-advanca.1", "repository": { "type": "git", "url": "https://github.com/hyperledger/caliper", @@ -23,21 +23,21 @@ }, "dependencies": { "@hapi/joi": "^15.1.1", - "@hyperledger/caliper-core": "0.3.2", + "@hyperledger/caliper-core": "^0.3.2-advanca.1", "semver": "7.1.1" }, "devDependencies": { + "chai": "^3.5.0", + "eslint": "^5.16.0", "fabric-ca-client": "^1.4.7", "fabric-client": "^1.4.7", "fabric-network": "^1.4.7", "fabric-protos": "2.0.0-snapshot.1", - "chai": "^3.5.0", - "eslint": "^5.16.0", + "license-check-and-add": "2.3.6", "mocha": "3.4.2", "nyc": "11.1.0", "rewire": "^4.0.0", - "sinon": "^7.3.2", - "license-check-and-add": "2.3.6" + "sinon": "^7.3.2" }, "license-check-and-add-config": { "folder": ".", @@ -90,4 +90,4 @@ "lines": 1 }, "license": "Apache-2.0" -} \ No newline at end of file +} diff --git a/packages/caliper-fisco-bcos/package.json b/packages/caliper-fisco-bcos/package.json index 39241c64e..6d93204e2 100644 --- a/packages/caliper-fisco-bcos/package.json +++ b/packages/caliper-fisco-bcos/package.json @@ -1,6 +1,6 @@ { "name": "@hyperledger/caliper-fisco-bcos", - "version": "0.3.2", + "version": "0.3.2-advanca.1", "description": "FISCO BCOS adaptor for Caliper, enabling the running of a performance benchmarks that interact with FISCO BCOS", "repository": { "type": "git", @@ -22,7 +22,7 @@ "npm": ">=5.6.0" }, "dependencies": { - "@hyperledger/caliper-core": "0.3.2", + "@hyperledger/caliper-core": "^0.3.2-advanca.1", "bn.js": "^4.11.8", "crypto-js": "^3.1.9-1", "ethereumjs-util": "^6.1.0", @@ -36,8 +36,8 @@ "uuid": "^3.3.2" }, "devDependencies": { - "web3": "0.20.7", - "license-check-and-add": "2.3.6" + "license-check-and-add": "2.3.6", + "web3": "0.20.7" }, "license-check-and-add-config": { "folder": ".", @@ -90,4 +90,4 @@ "lines": 5 }, "license": "Apache-2.0" -} \ No newline at end of file +} diff --git a/packages/caliper-gui-dashboard/package.json b/packages/caliper-gui-dashboard/package.json index 978ccf12d..d828c52b8 100755 --- a/packages/caliper-gui-dashboard/package.json +++ b/packages/caliper-gui-dashboard/package.json @@ -1,7 +1,7 @@ { "name": "@hyperledger/caliper-gui-dashboard", "description": "Hyperledger Caliper GUI dashboard module, for easily assembling configuration files and monitoring benchmark runs", - "version": "0.3.2", + "version": "0.3.2-advanca.1", "private": true, "repository": { "type": "git", @@ -145,4 +145,4 @@ "lines": 1 }, "license": "Apache-2.0" -} \ No newline at end of file +} diff --git a/packages/caliper-gui-server/package.json b/packages/caliper-gui-server/package.json index 4944d0b49..e1b19d1b5 100644 --- a/packages/caliper-gui-server/package.json +++ b/packages/caliper-gui-server/package.json @@ -1,7 +1,7 @@ { "name": "@hyperledger/caliper-gui-server", "description": "Hyperledger Caliper GUI server module, for easily assembling configuration files and monitoring benchmark runs", - "version": "0.3.2", + "version": "0.3.2-advanca.1", "private": true, "repository": { "type": "git", @@ -22,11 +22,11 @@ "npm": ">=5.6.0" }, "dependencies": { - "@hyperledger/caliper-burrow": "0.3.2", - "@hyperledger/caliper-core": "0.3.2", - "@hyperledger/caliper-fabric": "0.3.2", - "@hyperledger/caliper-iroha": "0.3.2", - "@hyperledger/caliper-sawtooth": "0.3.2", + "@hyperledger/caliper-burrow": "^0.3.2-advanca.1", + "@hyperledger/caliper-core": "^0.3.2-advanca.1", + "@hyperledger/caliper-fabric": "^0.3.2-advanca.1", + "@hyperledger/caliper-iroha": "^0.3.2-advanca.1", + "@hyperledger/caliper-sawtooth": "^0.3.2-advanca.1", "chalk": "1.1.3", "cors": "^2.8.5", "express": "^4.17.1", @@ -107,4 +107,4 @@ "lines": 1 }, "license": "Apache-2.0" -} \ No newline at end of file +} diff --git a/packages/caliper-iroha/package.json b/packages/caliper-iroha/package.json index e5a2a3718..6e3b46f4b 100644 --- a/packages/caliper-iroha/package.json +++ b/packages/caliper-iroha/package.json @@ -1,7 +1,7 @@ { "name": "@hyperledger/caliper-iroha", "description": "Hyperledger Iroha adaptor for Caliper, enabling the running of performance benchmarks that interact with Iroha", - "version": "0.3.2", + "version": "0.3.2-advanca.1", "repository": { "type": "git", "url": "https://github.com/hyperledger/caliper", @@ -22,17 +22,17 @@ "npm": ">=5.6.0" }, "dependencies": { - "@hyperledger/caliper-core": "0.3.2" + "@hyperledger/caliper-core": "^0.3.2-advanca.1" }, "devDependencies": { - "iroha-helpers": "0.8.8", "chai": "^3.5.0", "eslint": "^5.16.0", + "iroha-helpers": "0.8.8", + "license-check-and-add": "2.3.6", "mocha": "3.4.2", "nyc": "11.1.0", "rewire": "^4.0.0", - "sinon": "^7.3.2", - "license-check-and-add": "2.3.6" + "sinon": "^7.3.2" }, "license-check-and-add-config": { "folder": ".", @@ -85,4 +85,4 @@ "lines": 5 }, "license": "Apache-2.0" -} \ No newline at end of file +} diff --git a/packages/caliper-publish/caliper.Dockerfile b/packages/caliper-publish/caliper.Dockerfile index 5935d2ebc..c0079c04b 100644 --- a/packages/caliper-publish/caliper.Dockerfile +++ b/packages/caliper-publish/caliper.Dockerfile @@ -39,5 +39,8 @@ ENV PATH /home/node/.npm-global/bin:$PATH ENV CALIPER_WORKSPACE /hyperledger/caliper/workspace ENV CALIPER_BIND_ARGS -g +# FIXME: should remove this before contributing back to upstream +RUN caliper bind --caliper-bind-sut fisco-bcos:latest && npm install -g request uuid@3.3.2 chalk + ENTRYPOINT ["caliper"] CMD ["--version"] diff --git a/packages/caliper-publish/package.json b/packages/caliper-publish/package.json index 7a0821b0b..0782fd5bc 100644 --- a/packages/caliper-publish/package.json +++ b/packages/caliper-publish/package.json @@ -1,7 +1,7 @@ { "name": "caliper-publish", "description": "Hyperledger Caliper internal CLI for publishing packages", - "version": "0.3.2", + "version": "0.3.2-advanca.1", "private": true, "repository": { "type": "git", @@ -26,13 +26,13 @@ "devDependencies": { "chai": "^3.5.0", "eslint": "^5.16.0", + "license-check-and-add": "2.3.6", "mocha": "3.4.2", "nyc": "11.1.0", + "pm2": "2.10.1", "rewire": "^4.0.0", "sinon": "^7.3.2", - "pm2": "2.10.1", - "verdaccio": "3.12.0", - "license-check-and-add": "2.3.6" + "verdaccio": "3.12.0" }, "license-check-and-add-config": { "folder": ".", @@ -85,4 +85,4 @@ "lines": 5 }, "license": "Apache-2.0" -} \ No newline at end of file +} diff --git a/packages/caliper-sawtooth/package.json b/packages/caliper-sawtooth/package.json index a5d3c6e5f..05c083f5a 100644 --- a/packages/caliper-sawtooth/package.json +++ b/packages/caliper-sawtooth/package.json @@ -1,7 +1,7 @@ { "name": "@hyperledger/caliper-sawtooth", "description": "Hyperledger Sawtooth adaptor for Caliper, enabling the running of performance benchmarks that interact with Sawtooth", - "version": "0.3.2", + "version": "0.3.2-advanca.1", "repository": { "type": "git", "url": "https://github.com/hyperledger/caliper", @@ -22,19 +22,19 @@ "npm": ">=5.6.0" }, "dependencies": { - "@hyperledger/caliper-core": "0.3.2", - "request-promise": "^4.2.1", - "protocol-buffers": "^4.1.0" + "@hyperledger/caliper-core": "^0.3.2-advanca.1", + "protocol-buffers": "^4.1.0", + "request-promise": "^4.2.1" }, "devDependencies": { - "sawtooth-sdk": "^1.0.5", "chai": "^3.5.0", "eslint": "^5.16.0", + "license-check-and-add": "2.3.6", "mocha": "3.4.2", "nyc": "11.1.0", "rewire": "^4.0.0", - "sinon": "^7.3.2", - "license-check-and-add": "2.3.6" + "sawtooth-sdk": "^1.0.5", + "sinon": "^7.3.2" }, "license-check-and-add-config": { "folder": ".", @@ -87,4 +87,4 @@ "lines": 5 }, "license": "Apache-2.0" -} \ No newline at end of file +} diff --git a/packages/caliper-tests-integration/package.json b/packages/caliper-tests-integration/package.json index 427098d09..2bffc5126 100644 --- a/packages/caliper-tests-integration/package.json +++ b/packages/caliper-tests-integration/package.json @@ -1,6 +1,6 @@ { "name": "caliper-tests-integration", - "version": "0.3.2", + "version": "0.3.2-advanca.1", "private": true, "description": "Integration tests for Hyperledger Caliper", "scripts": { @@ -31,14 +31,14 @@ "license-check-and-add": "2.3.6" }, "dependencies": { - "@hyperledger/caliper-burrow": "0.3.2", - "@hyperledger/caliper-cli": "0.3.2", - "@hyperledger/caliper-core": "0.3.2", - "@hyperledger/caliper-ethereum": "0.3.2", - "@hyperledger/caliper-fabric": "0.3.2", - "@hyperledger/caliper-fisco-bcos": "0.3.2", - "@hyperledger/caliper-iroha": "0.3.2", - "@hyperledger/caliper-sawtooth": "0.3.2", + "@hyperledger/caliper-burrow": "^0.3.2-advanca.1", + "@hyperledger/caliper-cli": "^0.3.2-advanca.1", + "@hyperledger/caliper-core": "^0.3.2-advanca.1", + "@hyperledger/caliper-ethereum": "^0.3.2-advanca.1", + "@hyperledger/caliper-fabric": "^0.3.2-advanca.1", + "@hyperledger/caliper-fisco-bcos": "^0.3.2-advanca.1", + "@hyperledger/caliper-iroha": "^0.3.2-advanca.1", + "@hyperledger/caliper-sawtooth": "^0.3.2-advanca.1", "yeoman-generator": "4.1.0", "yosay": "^2.0.1" }, @@ -140,4 +140,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/generator-caliper/package.json b/packages/generator-caliper/package.json index f23ce85f0..e0159e620 100644 --- a/packages/generator-caliper/package.json +++ b/packages/generator-caliper/package.json @@ -1,7 +1,7 @@ { "name": "@hyperledger/generator-caliper", "description": "Yeoman generator for Hyperledger Caliper", - "version": "0.3.2", + "version": "0.3.2-advanca.1", "author": "Lynn Muswere", "homepage": "https://hyperledger.github.io/caliper/", "repository": { @@ -33,18 +33,18 @@ "yosay": "^2.0.1" }, "devDependencies": { - "js-yaml": "^3.13.1", + "chai": "^3.5.0", + "eslint": "^5.16.0", "fs-extra": "8.1.0", - "yeoman-assert": "^3.1.1", - "yeoman-test": "^1.7.0", + "js-yaml": "^3.13.1", + "license-check-and-add": "2.3.6", "mocha": "3.4.2", + "nyc": "11.1.0", + "rewire": "^4.0.0", "sinon": "^7.3.2", - "chai": "^3.5.0", "sinon-chai": "^3.3.0", - "eslint": "^5.16.0", - "rewire": "^4.0.0", - "nyc": "11.1.0", - "license-check-and-add": "2.3.6" + "yeoman-assert": "^3.1.1", + "yeoman-test": "^1.7.0" }, "license": "Apache-2.0", "licenses": [ @@ -102,4 +102,4 @@ "functions": 1, "lines": 1 } -} \ No newline at end of file +}