@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.
Files changed (164) hide show
  1. package/README.md +360 -0
  2. package/dist/cli/cli.d.ts +2 -0
  3. package/dist/cli/cli.js +192 -0
  4. package/dist/cli/commands/distributed.d.ts +11 -0
  5. package/dist/cli/commands/distributed.js +179 -0
  6. package/dist/cli/commands/import.d.ts +23 -0
  7. package/dist/cli/commands/import.js +461 -0
  8. package/dist/cli/commands/init.d.ts +7 -0
  9. package/dist/cli/commands/init.js +923 -0
  10. package/dist/cli/commands/mock.d.ts +7 -0
  11. package/dist/cli/commands/mock.js +281 -0
  12. package/dist/cli/commands/report.d.ts +5 -0
  13. package/dist/cli/commands/report.js +70 -0
  14. package/dist/cli/commands/run.d.ts +12 -0
  15. package/dist/cli/commands/run.js +260 -0
  16. package/dist/cli/commands/validate.d.ts +3 -0
  17. package/dist/cli/commands/validate.js +35 -0
  18. package/dist/cli/commands/worker.d.ts +27 -0
  19. package/dist/cli/commands/worker.js +320 -0
  20. package/dist/config/index.d.ts +2 -0
  21. package/dist/config/index.js +20 -0
  22. package/dist/config/parser.d.ts +19 -0
  23. package/dist/config/parser.js +330 -0
  24. package/dist/config/types/global-config.d.ts +74 -0
  25. package/dist/config/types/global-config.js +2 -0
  26. package/dist/config/types/hooks.d.ts +58 -0
  27. package/dist/config/types/hooks.js +3 -0
  28. package/dist/config/types/import-types.d.ts +33 -0
  29. package/dist/config/types/import-types.js +2 -0
  30. package/dist/config/types/index.d.ts +11 -0
  31. package/dist/config/types/index.js +27 -0
  32. package/dist/config/types/load-config.d.ts +32 -0
  33. package/dist/config/types/load-config.js +9 -0
  34. package/dist/config/types/output-config.d.ts +10 -0
  35. package/dist/config/types/output-config.js +2 -0
  36. package/dist/config/types/report-config.d.ts +10 -0
  37. package/dist/config/types/report-config.js +2 -0
  38. package/dist/config/types/runtime-types.d.ts +6 -0
  39. package/dist/config/types/runtime-types.js +2 -0
  40. package/dist/config/types/scenario-config.d.ts +30 -0
  41. package/dist/config/types/scenario-config.js +2 -0
  42. package/dist/config/types/step-types.d.ts +139 -0
  43. package/dist/config/types/step-types.js +2 -0
  44. package/dist/config/types/test-configuration.d.ts +18 -0
  45. package/dist/config/types/test-configuration.js +2 -0
  46. package/dist/config/types/worker-config.d.ts +12 -0
  47. package/dist/config/types/worker-config.js +2 -0
  48. package/dist/config/validator.d.ts +19 -0
  49. package/dist/config/validator.js +198 -0
  50. package/dist/core/csv-data-provider.d.ts +47 -0
  51. package/dist/core/csv-data-provider.js +265 -0
  52. package/dist/core/hooks-manager.d.ts +33 -0
  53. package/dist/core/hooks-manager.js +129 -0
  54. package/dist/core/index.d.ts +5 -0
  55. package/dist/core/index.js +11 -0
  56. package/dist/core/script-executor.d.ts +14 -0
  57. package/dist/core/script-executor.js +290 -0
  58. package/dist/core/step-executor.d.ts +41 -0
  59. package/dist/core/step-executor.js +680 -0
  60. package/dist/core/test-runner.d.ts +34 -0
  61. package/dist/core/test-runner.js +465 -0
  62. package/dist/core/threshold-evaluator.d.ts +43 -0
  63. package/dist/core/threshold-evaluator.js +170 -0
  64. package/dist/core/virtual-user-pool.d.ts +42 -0
  65. package/dist/core/virtual-user-pool.js +136 -0
  66. package/dist/core/virtual-user.d.ts +51 -0
  67. package/dist/core/virtual-user.js +488 -0
  68. package/dist/distributed/coordinator.d.ts +34 -0
  69. package/dist/distributed/coordinator.js +158 -0
  70. package/dist/distributed/health-monitor.d.ts +18 -0
  71. package/dist/distributed/health-monitor.js +72 -0
  72. package/dist/distributed/load-distributor.d.ts +17 -0
  73. package/dist/distributed/load-distributor.js +106 -0
  74. package/dist/distributed/remote-worker.d.ts +37 -0
  75. package/dist/distributed/remote-worker.js +241 -0
  76. package/dist/distributed/result-aggregator.d.ts +43 -0
  77. package/dist/distributed/result-aggregator.js +146 -0
  78. package/dist/dsl/index.d.ts +3 -0
  79. package/dist/dsl/index.js +11 -0
  80. package/dist/dsl/test-builder.d.ts +111 -0
  81. package/dist/dsl/test-builder.js +514 -0
  82. package/dist/importers/har-importer.d.ts +17 -0
  83. package/dist/importers/har-importer.js +172 -0
  84. package/dist/importers/open-api-importer.d.ts +23 -0
  85. package/dist/importers/open-api-importer.js +181 -0
  86. package/dist/importers/wsdl-importer.d.ts +42 -0
  87. package/dist/importers/wsdl-importer.js +440 -0
  88. package/dist/index.d.ts +5 -0
  89. package/dist/index.js +17 -0
  90. package/dist/load-patterns/arrivals.d.ts +7 -0
  91. package/dist/load-patterns/arrivals.js +118 -0
  92. package/dist/load-patterns/base.d.ts +9 -0
  93. package/dist/load-patterns/base.js +2 -0
  94. package/dist/load-patterns/basic.d.ts +7 -0
  95. package/dist/load-patterns/basic.js +117 -0
  96. package/dist/load-patterns/stepping.d.ts +6 -0
  97. package/dist/load-patterns/stepping.js +122 -0
  98. package/dist/metrics/collector.d.ts +72 -0
  99. package/dist/metrics/collector.js +662 -0
  100. package/dist/metrics/types.d.ts +135 -0
  101. package/dist/metrics/types.js +2 -0
  102. package/dist/outputs/base.d.ts +7 -0
  103. package/dist/outputs/base.js +2 -0
  104. package/dist/outputs/csv.d.ts +13 -0
  105. package/dist/outputs/csv.js +163 -0
  106. package/dist/outputs/graphite.d.ts +13 -0
  107. package/dist/outputs/graphite.js +126 -0
  108. package/dist/outputs/influxdb.d.ts +12 -0
  109. package/dist/outputs/influxdb.js +82 -0
  110. package/dist/outputs/json.d.ts +14 -0
  111. package/dist/outputs/json.js +107 -0
  112. package/dist/outputs/streaming-csv.d.ts +37 -0
  113. package/dist/outputs/streaming-csv.js +254 -0
  114. package/dist/outputs/streaming-json.d.ts +43 -0
  115. package/dist/outputs/streaming-json.js +353 -0
  116. package/dist/outputs/webhook.d.ts +16 -0
  117. package/dist/outputs/webhook.js +96 -0
  118. package/dist/protocols/base.d.ts +33 -0
  119. package/dist/protocols/base.js +2 -0
  120. package/dist/protocols/rest/handler.d.ts +67 -0
  121. package/dist/protocols/rest/handler.js +776 -0
  122. package/dist/protocols/soap/handler.d.ts +12 -0
  123. package/dist/protocols/soap/handler.js +165 -0
  124. package/dist/protocols/web/core-web-vitals.d.ts +121 -0
  125. package/dist/protocols/web/core-web-vitals.js +373 -0
  126. package/dist/protocols/web/handler.d.ts +50 -0
  127. package/dist/protocols/web/handler.js +706 -0
  128. package/dist/recorder/native-recorder.d.ts +14 -0
  129. package/dist/recorder/native-recorder.js +533 -0
  130. package/dist/recorder/scenario-recorder.d.ts +55 -0
  131. package/dist/recorder/scenario-recorder.js +296 -0
  132. package/dist/reporting/constants.d.ts +94 -0
  133. package/dist/reporting/constants.js +82 -0
  134. package/dist/reporting/enhanced-html-generator.d.ts +55 -0
  135. package/dist/reporting/enhanced-html-generator.js +965 -0
  136. package/dist/reporting/generator.d.ts +42 -0
  137. package/dist/reporting/generator.js +1217 -0
  138. package/dist/reporting/statistics.d.ts +144 -0
  139. package/dist/reporting/statistics.js +742 -0
  140. package/dist/reporting/templates/enhanced-report.hbs +2812 -0
  141. package/dist/reporting/templates/html.hbs +2453 -0
  142. package/dist/utils/faker-manager.d.ts +55 -0
  143. package/dist/utils/faker-manager.js +166 -0
  144. package/dist/utils/file-manager.d.ts +33 -0
  145. package/dist/utils/file-manager.js +154 -0
  146. package/dist/utils/handlebars-manager.d.ts +42 -0
  147. package/dist/utils/handlebars-manager.js +172 -0
  148. package/dist/utils/logger.d.ts +16 -0
  149. package/dist/utils/logger.js +46 -0
  150. package/dist/utils/template.d.ts +80 -0
  151. package/dist/utils/template.js +513 -0
  152. package/dist/utils/test-output-writer.d.ts +56 -0
  153. package/dist/utils/test-output-writer.js +643 -0
  154. package/dist/utils/time.d.ts +3 -0
  155. package/dist/utils/time.js +23 -0
  156. package/dist/utils/timestamp-helper.d.ts +17 -0
  157. package/dist/utils/timestamp-helper.js +53 -0
  158. package/dist/workers/manager.d.ts +18 -0
  159. package/dist/workers/manager.js +95 -0
  160. package/dist/workers/server.d.ts +21 -0
  161. package/dist/workers/server.js +205 -0
  162. package/dist/workers/worker.d.ts +19 -0
  163. package/dist/workers/worker.js +147 -0
  164. 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
+ }