@testsmith/perfornium 0.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/README.md +360 -0
- package/dist/cli/cli.d.ts +2 -0
- package/dist/cli/cli.js +192 -0
- package/dist/cli/commands/distributed.d.ts +11 -0
- package/dist/cli/commands/distributed.js +179 -0
- package/dist/cli/commands/import.d.ts +23 -0
- package/dist/cli/commands/import.js +461 -0
- package/dist/cli/commands/init.d.ts +7 -0
- package/dist/cli/commands/init.js +923 -0
- package/dist/cli/commands/mock.d.ts +7 -0
- package/dist/cli/commands/mock.js +281 -0
- package/dist/cli/commands/report.d.ts +5 -0
- package/dist/cli/commands/report.js +70 -0
- package/dist/cli/commands/run.d.ts +12 -0
- package/dist/cli/commands/run.js +260 -0
- package/dist/cli/commands/validate.d.ts +3 -0
- package/dist/cli/commands/validate.js +35 -0
- package/dist/cli/commands/worker.d.ts +27 -0
- package/dist/cli/commands/worker.js +320 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.js +20 -0
- package/dist/config/parser.d.ts +19 -0
- package/dist/config/parser.js +330 -0
- package/dist/config/types/global-config.d.ts +74 -0
- package/dist/config/types/global-config.js +2 -0
- package/dist/config/types/hooks.d.ts +58 -0
- package/dist/config/types/hooks.js +3 -0
- package/dist/config/types/import-types.d.ts +33 -0
- package/dist/config/types/import-types.js +2 -0
- package/dist/config/types/index.d.ts +11 -0
- package/dist/config/types/index.js +27 -0
- package/dist/config/types/load-config.d.ts +32 -0
- package/dist/config/types/load-config.js +9 -0
- package/dist/config/types/output-config.d.ts +10 -0
- package/dist/config/types/output-config.js +2 -0
- package/dist/config/types/report-config.d.ts +10 -0
- package/dist/config/types/report-config.js +2 -0
- package/dist/config/types/runtime-types.d.ts +6 -0
- package/dist/config/types/runtime-types.js +2 -0
- package/dist/config/types/scenario-config.d.ts +30 -0
- package/dist/config/types/scenario-config.js +2 -0
- package/dist/config/types/step-types.d.ts +139 -0
- package/dist/config/types/step-types.js +2 -0
- package/dist/config/types/test-configuration.d.ts +18 -0
- package/dist/config/types/test-configuration.js +2 -0
- package/dist/config/types/worker-config.d.ts +12 -0
- package/dist/config/types/worker-config.js +2 -0
- package/dist/config/validator.d.ts +19 -0
- package/dist/config/validator.js +198 -0
- package/dist/core/csv-data-provider.d.ts +47 -0
- package/dist/core/csv-data-provider.js +265 -0
- package/dist/core/hooks-manager.d.ts +33 -0
- package/dist/core/hooks-manager.js +129 -0
- package/dist/core/index.d.ts +5 -0
- package/dist/core/index.js +11 -0
- package/dist/core/script-executor.d.ts +14 -0
- package/dist/core/script-executor.js +290 -0
- package/dist/core/step-executor.d.ts +41 -0
- package/dist/core/step-executor.js +680 -0
- package/dist/core/test-runner.d.ts +34 -0
- package/dist/core/test-runner.js +465 -0
- package/dist/core/threshold-evaluator.d.ts +43 -0
- package/dist/core/threshold-evaluator.js +170 -0
- package/dist/core/virtual-user-pool.d.ts +42 -0
- package/dist/core/virtual-user-pool.js +136 -0
- package/dist/core/virtual-user.d.ts +51 -0
- package/dist/core/virtual-user.js +488 -0
- package/dist/distributed/coordinator.d.ts +34 -0
- package/dist/distributed/coordinator.js +158 -0
- package/dist/distributed/health-monitor.d.ts +18 -0
- package/dist/distributed/health-monitor.js +72 -0
- package/dist/distributed/load-distributor.d.ts +17 -0
- package/dist/distributed/load-distributor.js +106 -0
- package/dist/distributed/remote-worker.d.ts +37 -0
- package/dist/distributed/remote-worker.js +241 -0
- package/dist/distributed/result-aggregator.d.ts +43 -0
- package/dist/distributed/result-aggregator.js +146 -0
- package/dist/dsl/index.d.ts +3 -0
- package/dist/dsl/index.js +11 -0
- package/dist/dsl/test-builder.d.ts +111 -0
- package/dist/dsl/test-builder.js +514 -0
- package/dist/importers/har-importer.d.ts +17 -0
- package/dist/importers/har-importer.js +172 -0
- package/dist/importers/open-api-importer.d.ts +23 -0
- package/dist/importers/open-api-importer.js +181 -0
- package/dist/importers/wsdl-importer.d.ts +42 -0
- package/dist/importers/wsdl-importer.js +440 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +17 -0
- package/dist/load-patterns/arrivals.d.ts +7 -0
- package/dist/load-patterns/arrivals.js +118 -0
- package/dist/load-patterns/base.d.ts +9 -0
- package/dist/load-patterns/base.js +2 -0
- package/dist/load-patterns/basic.d.ts +7 -0
- package/dist/load-patterns/basic.js +117 -0
- package/dist/load-patterns/stepping.d.ts +6 -0
- package/dist/load-patterns/stepping.js +122 -0
- package/dist/metrics/collector.d.ts +72 -0
- package/dist/metrics/collector.js +662 -0
- package/dist/metrics/types.d.ts +135 -0
- package/dist/metrics/types.js +2 -0
- package/dist/outputs/base.d.ts +7 -0
- package/dist/outputs/base.js +2 -0
- package/dist/outputs/csv.d.ts +13 -0
- package/dist/outputs/csv.js +163 -0
- package/dist/outputs/graphite.d.ts +13 -0
- package/dist/outputs/graphite.js +126 -0
- package/dist/outputs/influxdb.d.ts +12 -0
- package/dist/outputs/influxdb.js +82 -0
- package/dist/outputs/json.d.ts +14 -0
- package/dist/outputs/json.js +107 -0
- package/dist/outputs/streaming-csv.d.ts +37 -0
- package/dist/outputs/streaming-csv.js +254 -0
- package/dist/outputs/streaming-json.d.ts +43 -0
- package/dist/outputs/streaming-json.js +353 -0
- package/dist/outputs/webhook.d.ts +16 -0
- package/dist/outputs/webhook.js +96 -0
- package/dist/protocols/base.d.ts +33 -0
- package/dist/protocols/base.js +2 -0
- package/dist/protocols/rest/handler.d.ts +67 -0
- package/dist/protocols/rest/handler.js +776 -0
- package/dist/protocols/soap/handler.d.ts +12 -0
- package/dist/protocols/soap/handler.js +165 -0
- package/dist/protocols/web/core-web-vitals.d.ts +121 -0
- package/dist/protocols/web/core-web-vitals.js +373 -0
- package/dist/protocols/web/handler.d.ts +50 -0
- package/dist/protocols/web/handler.js +706 -0
- package/dist/recorder/native-recorder.d.ts +14 -0
- package/dist/recorder/native-recorder.js +533 -0
- package/dist/recorder/scenario-recorder.d.ts +55 -0
- package/dist/recorder/scenario-recorder.js +296 -0
- package/dist/reporting/constants.d.ts +94 -0
- package/dist/reporting/constants.js +82 -0
- package/dist/reporting/enhanced-html-generator.d.ts +55 -0
- package/dist/reporting/enhanced-html-generator.js +965 -0
- package/dist/reporting/generator.d.ts +42 -0
- package/dist/reporting/generator.js +1217 -0
- package/dist/reporting/statistics.d.ts +144 -0
- package/dist/reporting/statistics.js +742 -0
- package/dist/reporting/templates/enhanced-report.hbs +2812 -0
- package/dist/reporting/templates/html.hbs +2453 -0
- package/dist/utils/faker-manager.d.ts +55 -0
- package/dist/utils/faker-manager.js +166 -0
- package/dist/utils/file-manager.d.ts +33 -0
- package/dist/utils/file-manager.js +154 -0
- package/dist/utils/handlebars-manager.d.ts +42 -0
- package/dist/utils/handlebars-manager.js +172 -0
- package/dist/utils/logger.d.ts +16 -0
- package/dist/utils/logger.js +46 -0
- package/dist/utils/template.d.ts +80 -0
- package/dist/utils/template.js +513 -0
- package/dist/utils/test-output-writer.d.ts +56 -0
- package/dist/utils/test-output-writer.js +643 -0
- package/dist/utils/time.d.ts +3 -0
- package/dist/utils/time.js +23 -0
- package/dist/utils/timestamp-helper.d.ts +17 -0
- package/dist/utils/timestamp-helper.js +53 -0
- package/dist/workers/manager.d.ts +18 -0
- package/dist/workers/manager.js +95 -0
- package/dist/workers/server.d.ts +21 -0
- package/dist/workers/server.js +205 -0
- package/dist/workers/worker.d.ts +19 -0
- package/dist/workers/worker.js +147 -0
- package/package.json +102 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { TestResult } from '../metrics/types';
|
|
2
|
+
import { SLA_DEFAULTS } from './constants';
|
|
3
|
+
/**
|
|
4
|
+
* Check if a result should be included in statistics (only verifications/measurements)
|
|
5
|
+
*/
|
|
6
|
+
export declare function isMeasurableResult(result: TestResult): boolean;
|
|
7
|
+
export interface ApdexScore {
|
|
8
|
+
score: number;
|
|
9
|
+
satisfied: number;
|
|
10
|
+
tolerating: number;
|
|
11
|
+
frustrated: number;
|
|
12
|
+
total: number;
|
|
13
|
+
rating: 'Excellent' | 'Good' | 'Fair' | 'Poor' | 'Unacceptable';
|
|
14
|
+
}
|
|
15
|
+
export interface SLACompliance {
|
|
16
|
+
passed: boolean;
|
|
17
|
+
checks: SLACheck[];
|
|
18
|
+
summary: string;
|
|
19
|
+
}
|
|
20
|
+
export interface SLACheck {
|
|
21
|
+
name: string;
|
|
22
|
+
target: number;
|
|
23
|
+
actual: number;
|
|
24
|
+
passed: boolean;
|
|
25
|
+
unit: string;
|
|
26
|
+
}
|
|
27
|
+
export interface OutlierAnalysis {
|
|
28
|
+
outliers: OutlierPoint[];
|
|
29
|
+
outlierCount: number;
|
|
30
|
+
outlierPercentage: number;
|
|
31
|
+
lowerBound: number;
|
|
32
|
+
upperBound: number;
|
|
33
|
+
method: 'IQR' | 'Z-Score';
|
|
34
|
+
}
|
|
35
|
+
export interface OutlierPoint {
|
|
36
|
+
value: number;
|
|
37
|
+
timestamp: number;
|
|
38
|
+
vu_id: number;
|
|
39
|
+
step_name?: string;
|
|
40
|
+
severity: 'mild' | 'extreme';
|
|
41
|
+
}
|
|
42
|
+
export interface ConfidenceInterval {
|
|
43
|
+
mean: number;
|
|
44
|
+
lower: number;
|
|
45
|
+
upper: number;
|
|
46
|
+
confidenceLevel: number;
|
|
47
|
+
standardError: number;
|
|
48
|
+
marginOfError: number;
|
|
49
|
+
}
|
|
50
|
+
export interface HeatmapData {
|
|
51
|
+
data: number[][];
|
|
52
|
+
timeLabels: string[];
|
|
53
|
+
responseTimeLabels: string[];
|
|
54
|
+
maxValue: number;
|
|
55
|
+
}
|
|
56
|
+
export declare class StatisticsCalculator {
|
|
57
|
+
/**
|
|
58
|
+
* Calculate percentiles using linear interpolation (consistent method)
|
|
59
|
+
*/
|
|
60
|
+
static calculatePercentiles(values: number[], percentiles?: number[]): Record<number, number>;
|
|
61
|
+
/**
|
|
62
|
+
* Calculate Apdex (Application Performance Index) score
|
|
63
|
+
* Industry-standard metric for user satisfaction
|
|
64
|
+
* Only includes measurable results (verifications, not actions like click/fill)
|
|
65
|
+
*/
|
|
66
|
+
static calculateApdexScore(results: TestResult[], satisfiedThreshold?: number): ApdexScore;
|
|
67
|
+
/**
|
|
68
|
+
* Check SLA compliance against defined thresholds
|
|
69
|
+
* Only measures verifications, not actions like click/fill
|
|
70
|
+
*/
|
|
71
|
+
static checkSLACompliance(results: TestResult[], slaConfig?: Partial<typeof SLA_DEFAULTS>): SLACompliance;
|
|
72
|
+
/**
|
|
73
|
+
* Detect outliers using IQR method
|
|
74
|
+
* Only analyzes measurable results (verifications, not actions like click/fill)
|
|
75
|
+
*/
|
|
76
|
+
static detectOutliers(results: TestResult[]): OutlierAnalysis;
|
|
77
|
+
/**
|
|
78
|
+
* Calculate confidence interval for mean response time
|
|
79
|
+
*/
|
|
80
|
+
static calculateConfidenceInterval(values: number[], confidenceLevel?: number): ConfidenceInterval;
|
|
81
|
+
/**
|
|
82
|
+
* Generate heatmap data for response time over time visualization
|
|
83
|
+
* Only includes measurable results (verifications, not actions like click/fill)
|
|
84
|
+
*/
|
|
85
|
+
static generateHeatmapData(results: TestResult[], timeBuckets?: number, responseTimeBuckets?: number): HeatmapData;
|
|
86
|
+
/**
|
|
87
|
+
* O(n) time-based grouping using Map-based bucketing
|
|
88
|
+
* FIXED: Replaces O(n²) filter-based implementation
|
|
89
|
+
*/
|
|
90
|
+
static groupResultsByTime(results: TestResult[], intervalMs?: number): any[];
|
|
91
|
+
/**
|
|
92
|
+
* Calculate enhanced statistics including all metrics
|
|
93
|
+
*/
|
|
94
|
+
static calculateEnhancedStatistics(values: number[]): {
|
|
95
|
+
count: number;
|
|
96
|
+
min: number;
|
|
97
|
+
max: number;
|
|
98
|
+
mean: number;
|
|
99
|
+
median: number;
|
|
100
|
+
stdDev: number;
|
|
101
|
+
percentiles: Record<number, number>;
|
|
102
|
+
confidenceInterval: ConfidenceInterval;
|
|
103
|
+
};
|
|
104
|
+
static calculateThroughput(results: TestResult[], totalDurationMs: number): number;
|
|
105
|
+
static calculateErrorRate(results: TestResult[]): number;
|
|
106
|
+
/**
|
|
107
|
+
* Calculate aggregated Core Web Vitals statistics
|
|
108
|
+
*/
|
|
109
|
+
static calculateWebVitalsStatistics(results: TestResult[]): {
|
|
110
|
+
web_vitals_data?: any;
|
|
111
|
+
vitals_score?: 'good' | 'needs-improvement' | 'poor';
|
|
112
|
+
vitals_details?: any;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Enhanced response time distribution with adaptive bucketing
|
|
116
|
+
* Only includes measurable results (verifications, not actions like click/fill)
|
|
117
|
+
*/
|
|
118
|
+
static calculateResponseTimeDistribution(results: TestResult[], targetBuckets?: number): any[];
|
|
119
|
+
/**
|
|
120
|
+
* Calculate detailed step statistics (single source of truth)
|
|
121
|
+
* Only includes measurable results (verifications, waits, measurements)
|
|
122
|
+
* Excludes actions like click, fill, press, goto, select
|
|
123
|
+
*/
|
|
124
|
+
static calculateDetailedStepStatistics(results: TestResult[]): any[];
|
|
125
|
+
/**
|
|
126
|
+
* Calculate error distribution and patterns
|
|
127
|
+
*/
|
|
128
|
+
static calculateErrorDistribution(results: TestResult[]): any;
|
|
129
|
+
/**
|
|
130
|
+
* Calculate performance trends using linear regression
|
|
131
|
+
* Only analyzes measurable results (verifications, not actions like click/fill)
|
|
132
|
+
*/
|
|
133
|
+
static calculatePerformanceTrends(results: TestResult[]): any;
|
|
134
|
+
/**
|
|
135
|
+
* Get comprehensive analysis of test results
|
|
136
|
+
*/
|
|
137
|
+
static getComprehensiveAnalysis(results: TestResult[], slaConfig?: Partial<typeof SLA_DEFAULTS>): {
|
|
138
|
+
apdex: ApdexScore;
|
|
139
|
+
sla: SLACompliance;
|
|
140
|
+
outliers: OutlierAnalysis;
|
|
141
|
+
trends: any;
|
|
142
|
+
heatmap: HeatmapData;
|
|
143
|
+
};
|
|
144
|
+
}
|