Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

testable-utils

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

testable-utils - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

2

lib/main.js

@@ -16,2 +16,4 @@

client: 0,
globalClientIndex: 0,
regionalClientIndex: 0,
chunk: {

@@ -18,0 +20,0 @@ id: -1,

@@ -98,2 +98,11 @@ const request = require('request');

});
},
metered: function() {
const options = toMetricOptions(arguments, true);
if (options)
return sendResult({
type: 'Metered',
data: { resource: resource, url: url,namespace: options.namespace, name: options.name,
key: options.key, val: options.val, units: options.units }
});
}

@@ -100,0 +109,0 @@ };

@@ -97,2 +97,6 @@ const _ = require('lodash');

});
browser.addCommand('testableMetered', function(result) {
const args = Array.prototype.slice.call(arguments, 1);
return result.metered.apply(result, args);
});
browser.addCommand('testableGetMetric', function() {

@@ -99,0 +103,0 @@ return results.get.apply(results, arguments);

2

package.json
{
"name": "testable-utils",
"version": "0.3.3",
"version": "0.3.4",
"description": "Utilities for Testable scripts",

@@ -5,0 +5,0 @@ "author": "Avi Stramer",

@@ -88,2 +88,24 @@ # Testable Script Utilities

#### Metered
```javscript
results([resource], [url]).metered(name, bucket, val, [units])
results([resource], [url]).histogram(options)
```
A metered metric is intended to capture live utilization of a resource in a particular bucket. Testable uses metered metrics to capture CPU utilization, memory utilization, active connections, and bandwidth per test runner.
Testable will calculate the peak value across all buckets in each 10 second time interval during the test. For example, this can be used to observe the test runner with the highest CPU utilization.
Namespace defaults to `User`. Resource and url default to blank and are included with the "overall results".
For example:
```javscript
const results = require('testable-utils').results;
const info = require('testable-utils').info;
results().metered('Browser Heap Memory', `User ${info.globalClientIndex} - Chrome`, 1025781, 'bytes');
```
##### Get execution wide metric value

@@ -90,0 +112,0 @@

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