Socket
Socket
Sign inDemoInstall

@hyperledger/caliper-core

Package Overview
Dependencies
Maintainers
4
Versions
278
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hyperledger/caliper-core - npm Package Compare versions

Comparing version 0.5.0-unstable-20220323105926 to 0.5.0-unstable-20220324180635

9

lib/common/prometheus/prometheus-query-client.js

@@ -152,8 +152,9 @@ /*

});
res.on('error', err => {
Logger.error(err);
reject(err);
});
});
req.on('error', err => {
Logger.error(err);
reject(err);
});
req.end();

@@ -160,0 +161,0 @@ });

@@ -68,3 +68,3 @@ /*

*/
getQueryClient(){
getQueryClient() {
return this.prometheusQueryClient;

@@ -78,3 +78,3 @@ }

async start() {
this.startTime = Date.now()/1000;
this.startTime = Date.now() / 1000;
}

@@ -119,3 +119,3 @@

async getStatistics(testLabel) {
this.endTime = Date.now()/1000;
this.endTime = Date.now() / 1000;

@@ -137,4 +137,11 @@ const resourceStats = [];

const queryString = PrometheusQueryHelper.buildStringRangeQuery(queryObject.query, this.startTime, this.endTime, queryObject.step);
const response = await this.prometheusQueryClient.getByEncodedUrl(queryString);
let response;
try {
response = await this.prometheusQueryClient.getByEncodedUrl(queryString);
} catch (error) {
Logger.warn('Failed to connect to Prometheus, unable to perform queries');
break;
}
// Retrieve map of component names and corresponding values for the issued query

@@ -153,3 +160,3 @@ const componentNameValueMap = PrometheusQueryHelper.extractStatisticFromRange(response, queryObject.statistic, queryObject.label);

const multiplier = queryObject.multiplier ? queryObject.multiplier : 1;
watchItemStat.set('Value', (value*multiplier).toPrecision(this.precision));
watchItemStat.set('Value', (value * multiplier).toPrecision(this.precision));
// Store

@@ -160,3 +167,3 @@ resourceStats.push(watchItemStat);

const metricMap = new Map();
metricMap.set('Name', watchItemStat.get('Name'));
metricMap.set('Name', watchItemStat.get('Name'));
metricMap.set(queryObject.name, watchItemStat.get('Value'));

@@ -163,0 +170,0 @@ metricArray.push(metricMap);

{
"name": "@hyperledger/caliper-core",
"description": "Core Hyperledger Caliper module, used for running performance benchmarks that interact with blockchain technologies",
"version": "0.5.0-unstable-20220323105926",
"version": "0.5.0-unstable-20220324180635",
"repository": {

@@ -6,0 +6,0 @@ "type": "git",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc