Im using hyperledger caliper to benchmark my local fabric network but i have some errors which lead to missing some values from report such as successful transactions and latency. any one can help me to fix these errors? as follow :
toor@toor-VirtualBox:~/caliper-workspace$ **npx caliper launch manager --caliper-workspace ./ --caliper-networkconfig networks/networkConfig.yaml --caliper-benchconfig benchmarks/myAssetBenchmark.yaml --caliper-flow-only-test --caliper-fabric-gateway-enabled**
2022-04-20T07:42:51.316Z - error: [RoundRobinQueryHandler]: evaluate: message=Query failed. Errors: [], stack=FabricError: Query failed. Errors: []
at RoundRobinQueryHandler.evaluate (/home/toor/caliper-workspace/node_modules/fabric-network/lib/impl/query/roundrobinqueryhandler.js:66:23)
at Transaction.evaluate (/home/toor/caliper-workspace/node_modules/fabric-network/lib/transaction.js:319:49)
2022.04.20-10:42:51.318 error [caliper] [connectors/v2/FabricGateway] Failed to perform query transaction [ReadAsset] using arguments [0_8], with error: FabricError: Query failed. Errors: []
at RoundRobinQueryHandler.evaluate (/home/toor/caliper-workspace/node_modules/fabric-network/lib/impl/query/roundrobinqueryhandler.js:66:23)
2022-04-20T07:42:57.401Z - error: [Transaction]: Error: No valid responses from any peers. Errors:
at newEndorsementError (/home/toor/caliper-workspace/node_modules/fabric-network/lib/transaction.js:74:12)
at getResponsePayload (/home/toor/caliper-workspace/node_modules/fabric-network/lib/transaction.js:41:23)
at Transaction.submit (/home/toor/caliper-workspace/node_modules/fabric-network/lib/transaction.js:255:28)
at async V2FabricGateway._submitOrEvaluateTransaction (/home/toor/caliper-workspace/node_modules/@hyperledger/caliper-fabric/lib/connector-versions/v2/FabricGateway.js:376:26)
2022.04.20-10:42:57.509 error [caliper] [connectors/v2/FabricGateway] Failed to perform submit transaction [DeleteAsset] using arguments [1_2], with error: Error: No valid responses from any peers.
2022.04.20-10:42:57.759 info [caliper] [connectors/v2/FabricGateway] disconnecting gateway for user User1
2022.04.20-10:42:57.764 info [caliper] [worker-message-handler] Worker#1 finished Round#0
2022.04.20-10:43:02.773 info [caliper] [default-observer] Resetting txCount indicator count
2022.04.20-10:43:02.777 info [caliper] [report-builder] ### Test result ###
2022.04.20-10:43:02.835 info [caliper] [report-builder]
+-----------+------+------+-----------------+-----------------+------------------+-----------------+------------------+
| Name | Succ | Fail | Send Rate (TPS) | Max Latency (s) | Min Latency (s) | Avg Latency (s) | Throughput (TPS) |
|-----------|------|------|-----------------|-----------------|------------------|-----------------|------------------|
| readAsset | 0 | 1693 | 57.2 | 0.00 | 9007199254740.99 | - | 57.2 |
+-----------+------+------+-----------------+-----------------+------------------+-----------------+------------------+
2022.04.20-10:43:02.842 info [caliper] [round-orchestrator] Finished round 1 (readAsset) in 30.138 seconds
2022.04.20-10:43:02.844 info [caliper] [monitor.js] Stopping all monitors
2022.04.20-10:43:02.855 info [caliper] [report-builder] ### All test results ###
2022.04.20-10:43:02.869 info [caliper] [report-builder]
+-----------+------+------+-----------------+-----------------+------------------+-----------------+------------------+
| Name | Succ | Fail | Send Rate (TPS) | Max Latency (s) | Min Latency (s) | Avg Latency (s) | Throughput (TPS) |
|-----------|------|------|-----------------|-----------------|------------------|-----------------|------------------|
| readAsset | 0 | 1693 | 57.2 | 0.00 | 9007199254740.99 | - | 57.2 |
+-----------+------+------+-----------------+-----------------+------------------+-----------------+------------------+
2022.04.20-10:43:02.987 info [caliper] [report-builder] Generated report with path /home/toor/caliper-workspace/report.html
2022.04.20-10:43:02.988 info [caliper] [monitor.js] Stopping all monitors
2022.04.20-10:43:02.990 info [caliper] [worker-orchestrator] Sending exit message to connected workers
2022.04.20-10:43:02.991 info [caliper] [worker-message-handler] Worker#0 is exiting
2022.04.20-10:43:02.994 info [caliper] [worker-message-handler] Worker#1 is exiting
2022.04.20-10:43:02.995 info [caliper] [round-orchestrator] Benchmark finished in 42.057 seconds. Total rounds: 1. Successful rounds: 1. Failed rounds: 0.
2022.04.20-10:43:02.996 info [caliper] [caliper-engine] Skipping end command due to benchmark flow conditioning
2022.04.20-10:43:02.997 info [caliper] [cli-launch-manager] Benchmark successfully finished
my network configration file is : networkConfig.yaml
name: Calier test
version: "2.0.0"
caliper:
blockchain: fabric
sutOptions:
mutualTls: false
channels:
- channelName: mychannel
contracts:
- id: basic
organizations:
- mspid: Org1MSP
identities:
certificates:
- name: 'User1'
clientPrivateKey:
path: '/home/toor/EHRUsingBlockchain-master/fabric-scripts/hlfv12/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457_sk'
clientSignedCert:
path: '/home/toor/EHRUsingBlockchain-master/fabric-scripts/hlfv12/composer/crypto-config/peerOrganizations/org1.example.com/msp/cacerts/ca.org1.example.com-cert.pem'
connectionProfile:
path: '/home/toor/EHRUsingBlockchain-master/DevServer_connection.json'
discover: false
and benchmarks file : myAssetBenchmark.yaml
test:
name: basic-contract-benchmark
description: test benchmark
workers:
type: local
number: 2
rounds:
- label: readAsset
description: Read asset benchmark
txDuration: 30
rateControl:
type: fixed-load
opts:
transactionLoad: 2
workload:
module: workload/readAsset.js
arguments:
assets: 10
contractId: basic
and my workload file : readAsset.js
'use strict';
const { WorkloadModuleBase } = require('@hyperledger/caliper-core');
class MyWorkload extends WorkloadModuleBase {
constructor() {
super();
}
async initializeWorkloadModule(workerIndex, totalWorkers, roundIndex, roundArguments, sutAdapter, sutContext) {
await super.initializeWorkloadModule(workerIndex, totalWorkers, roundIndex, roundArguments, sutAdapter, sutContext);
for (let i=0; i<this.roundArguments.assets; i++) {
const assetID = `${this.workerIndex}_${i}`;
console.log(`Worker ${this.workerIndex}: Creating asset ${assetID}`);
const request = {
contractId: this.roundArguments.contractId,
contractFunction: 'CreateAsset',
invokerIdentity: 'User1',
contractArguments: [assetID,'blue','20','penguin','500'],
readOnly: false
};
await this.sutAdapter.sendRequests(request);
}
}
async submitTransaction() {
const randomId = Math.floor(Math.random()*this.roundArguments.assets);
const myArgs = {
contractId: this.roundArguments.contractId,
contractFunction: 'ReadAsset',
invokerIdentity: 'User1',
contractArguments: [`${this.workerIndex}_${randomId}`],
readOnly: true
};
await this.sutAdapter.sendRequests(myArgs);
}
async cleanupWorkloadModule() {
for (let i=0; i<this.roundArguments.assets; i++) {
const assetID = `${this.workerIndex}_${i}`;
console.log(`Worker ${this.workerIndex}: Deleting asset ${assetID}`);
const request = {
contractId: this.roundArguments.contractId,
contractFunction: 'DeleteAsset',
invokerIdentity: 'User1',
contractArguments: [assetID],
readOnly: false
};
await this.sutAdapter.sendRequests(request);
}
}
}
function createWorkloadModule() {