@velocitycareerlabs/tps-testing 1.27.0-dev-build.12eb00e9e → 1.27.0-dev-build.1855c66b1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/tx-by-rate-limit.js +6 -8
- package/src/tx-per-batch.js +5 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@velocitycareerlabs/tps-testing",
|
|
3
|
-
"version": "1.27.0-dev-build.
|
|
3
|
+
"version": "1.27.0-dev-build.1855c66b1",
|
|
4
4
|
"description": "A tool for testing tx loads on the vc-api.",
|
|
5
5
|
"repository": "https://github.com/velocitycareerlabs/packages",
|
|
6
6
|
"main": "index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"test": "node ./test/ignore.js",
|
|
11
11
|
"test:ci": "node ./test/ignore.js",
|
|
12
12
|
"lint": "eslint . --format json >> eslint.json",
|
|
13
|
-
"lint:fix": "eslint --fix
|
|
13
|
+
"lint:fix": "eslint --fix."
|
|
14
14
|
},
|
|
15
15
|
"author": "Itay Podhajcer",
|
|
16
16
|
"license": "Apache-2.0",
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"got": "11.8.6",
|
|
22
22
|
"limiter": "^2.1.0"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "fd86e9b81abf073929994a43100694f30cd97bd6"
|
|
25
25
|
}
|
package/src/tx-by-rate-limit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const { RateLimiter } = require('limiter');
|
|
2
|
-
const got = require('got');
|
|
3
1
|
const console = require('console');
|
|
4
2
|
const fs = require('fs');
|
|
3
|
+
const { RateLimiter } = require('limiter');
|
|
4
|
+
const got = require('got');
|
|
5
5
|
|
|
6
6
|
const payload = {
|
|
7
7
|
credential: {
|
|
@@ -56,9 +56,7 @@ const perfStartTime = performance.now();
|
|
|
56
56
|
const startTime = new Date();
|
|
57
57
|
console.log(`Start time: ${startTime.toISOString()}`);
|
|
58
58
|
|
|
59
|
-
const getLatency = () =>
|
|
60
|
-
return Math.floor(performance.now() - perfStartTime);
|
|
61
|
-
};
|
|
59
|
+
const getLatency = () => Math.floor(performance.now() - perfStartTime);
|
|
62
60
|
|
|
63
61
|
const initLog = (logStartTime) => {
|
|
64
62
|
const fileName = `tx-by-rate-limit-${logStartTime.toISOString()}.log`;
|
|
@@ -66,7 +64,7 @@ const initLog = (logStartTime) => {
|
|
|
66
64
|
const log = (s) => {
|
|
67
65
|
const timeLog = `(${getLatency()}ms)`.padEnd(15, ' ');
|
|
68
66
|
stream.write(`${timeLog} ${s}\n`);
|
|
69
|
-
|
|
67
|
+
|
|
70
68
|
console.log(`${timeLog} ${s}`);
|
|
71
69
|
};
|
|
72
70
|
const closeStream = () => {
|
|
@@ -109,8 +107,8 @@ const issueCredential = async (idx, _total) => {
|
|
|
109
107
|
|
|
110
108
|
log(
|
|
111
109
|
`Request ${requestNumber} complete (${Math.floor(
|
|
112
|
-
performance.now() - requestStartTime
|
|
113
|
-
)}ms)
|
|
110
|
+
performance.now() - requestStartTime,
|
|
111
|
+
)}ms)`,
|
|
114
112
|
);
|
|
115
113
|
if (count >= _total) {
|
|
116
114
|
handleFinal();
|
package/src/tx-per-batch.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
const console = require('console');
|
|
1
2
|
const { RateLimiter } = require('limiter');
|
|
2
3
|
const got = require('got');
|
|
3
|
-
const console = require('console');
|
|
4
4
|
|
|
5
5
|
const payload = {
|
|
6
6
|
credential: {
|
|
@@ -55,13 +55,11 @@ const perfStartTime = performance.now();
|
|
|
55
55
|
const startTime = new Date();
|
|
56
56
|
console.log(`Start time: ${startTime.toISOString()}`);
|
|
57
57
|
|
|
58
|
-
const getLatency = () =>
|
|
59
|
-
return Math.floor(performance.now() - perfStartTime);
|
|
60
|
-
};
|
|
58
|
+
const getLatency = () => Math.floor(performance.now() - perfStartTime);
|
|
61
59
|
|
|
62
60
|
const log = (s) => {
|
|
63
61
|
const timeLog = `(${getLatency()}ms)`.padEnd(15, ' ');
|
|
64
|
-
|
|
62
|
+
|
|
65
63
|
console.log(`${timeLog} ${s}`);
|
|
66
64
|
};
|
|
67
65
|
|
|
@@ -97,8 +95,8 @@ const issueCredential = async (idx, _total) => {
|
|
|
97
95
|
|
|
98
96
|
log(
|
|
99
97
|
`Request ${requestNumber} complete (${Math.floor(
|
|
100
|
-
performance.now() - requestStartTime
|
|
101
|
-
)}ms)
|
|
98
|
+
performance.now() - requestStartTime,
|
|
99
|
+
)}ms)`,
|
|
102
100
|
);
|
|
103
101
|
if (count >= _total) {
|
|
104
102
|
finalLog();
|