word-stress 1.0.0 → 1.1.0
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/CHANGELOG.md +11 -0
- package/package.json +1 -1
- package/src/main.js +37 -8
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.1.0] - 2026-01-07
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Progress indicator with elapsed time for long-running tests using ora spinner
|
|
12
|
+
- Better UX feedback during test execution
|
|
13
|
+
- Automatic progress updates every 500ms showing elapsed time vs total duration
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- All CLI help text now references `word-stress` instead of `wordstress` for consistency
|
|
17
|
+
- Updated ESLint configuration to match renamed binary
|
|
18
|
+
|
|
8
19
|
## [1.0.0] - 2026-01-07
|
|
9
20
|
|
|
10
21
|
### Added - Phase 1: Project Setup
|
package/package.json
CHANGED
package/src/main.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Orchestrates the stress testing workflow
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
const oraFactory = require('ora');
|
|
6
7
|
const logger = require('./logger');
|
|
7
8
|
const { buildConfig, validate } = require('./config');
|
|
8
9
|
const { getTestMode } = require('./test-modes/factory');
|
|
@@ -12,6 +13,9 @@ const { makeRequest } = require('./http/client');
|
|
|
12
13
|
const MetricsCollector = require('./metrics/MetricsCollector');
|
|
13
14
|
const { resolveUserAgent } = require('./user-agent');
|
|
14
15
|
|
|
16
|
+
// Get ora function from ESM default export
|
|
17
|
+
const ora = oraFactory.default || oraFactory;
|
|
18
|
+
|
|
15
19
|
/**
|
|
16
20
|
* Main application function
|
|
17
21
|
* @param {Object} args - Parsed CLI arguments
|
|
@@ -55,15 +59,40 @@ async function main(args) {
|
|
|
55
59
|
const metricsCollector = new MetricsCollector();
|
|
56
60
|
const formatter = getFormatter(config.output);
|
|
57
61
|
|
|
58
|
-
//
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
);
|
|
62
|
+
// Setup progress tracking spinner
|
|
63
|
+
const spinner = ora({
|
|
64
|
+
text: `Running ${config.mode} test...`,
|
|
65
|
+
spinner: 'dots',
|
|
66
|
+
}).start();
|
|
67
|
+
|
|
68
|
+
const startTime = Date.now();
|
|
69
|
+
|
|
70
|
+
// Update progress every 500ms for long tests
|
|
71
|
+
const progressInterval = setInterval(() => {
|
|
72
|
+
const elapsed = ((Date.now() - startTime) / 1000).toFixed(1);
|
|
73
|
+
const totalDuration = config.mode === 'burst' ? '~1s' : `${config.duration}s`;
|
|
74
|
+
spinner.text = `Running ${config.mode} test (${elapsed}s / ${totalDuration})...`;
|
|
75
|
+
}, 500);
|
|
63
76
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
77
|
+
try {
|
|
78
|
+
// Run the test with user agent
|
|
79
|
+
const results = await testMode.run(
|
|
80
|
+
{ makeRequest: (url, options) => makeRequest(url, { ...options, userAgent }) },
|
|
81
|
+
metricsCollector
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
clearInterval(progressInterval);
|
|
85
|
+
const elapsed = ((Date.now() - startTime) / 1000).toFixed(2);
|
|
86
|
+
spinner.succeed(`Test complete in ${elapsed}s`);
|
|
87
|
+
|
|
88
|
+
// Format and output results
|
|
89
|
+
const output = formatter.format(results);
|
|
90
|
+
logger.log(output);
|
|
91
|
+
} catch (error) {
|
|
92
|
+
clearInterval(progressInterval);
|
|
93
|
+
spinner.fail(`Test failed: ${error.message}`);
|
|
94
|
+
throw error;
|
|
95
|
+
}
|
|
67
96
|
} catch (error) {
|
|
68
97
|
logger.error(error.message);
|
|
69
98
|
process.exit(1);
|