testable-utils
Advanced tools
Comparing version 0.3.3 to 0.3.4
@@ -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); |
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42606
726
475