@loadstrike/loadstrike-sdk 1.0.21401 → 1.0.22301

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/dist/cjs/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OtelCollectorReportingSinkOptions = exports.OtelCollectorReportingSink = exports.InfluxDbReportingSinkOptions = exports.InfluxDbReportingSink = exports.GrafanaLokiReportingSinkOptions = exports.GrafanaLokiReportingSink = exports.DatadogReportingSinkOptions = exports.DatadogReportingSink = exports.HttpAuthOptions = exports.HttpOAuth2ClientCredentialsOptions = exports.PushDiffusionEndpointDefinition = exports.DelegateStreamEndpointDefinition = exports.AzureEventHubsEndpointDefinition = exports.RedisStreamsEndpointDefinition = exports.NatsEndpointDefinition = exports.RabbitMqEndpointDefinition = exports.KafkaSaslOptions = exports.KafkaEndpointDefinition = exports.HttpEndpointDefinition = exports.TrafficEndpointDefinition = exports.EndpointAdapterFactory = exports.TrackingFieldSelector = exports.TrackingPayloadBuilder = exports.RedisCorrelationStore = exports.RedisCorrelationStoreOptions = exports.InMemoryCorrelationStore = exports.CrossPlatformTrackingRuntime = exports.CorrelationStoreConfiguration = exports.LoadStrikeThreshold = exports.LoadStrikeStep = exports.LoadStrikeGauge = exports.LoadStrikeCounter = exports.LoadStrikeMetric = exports.LoadStrikeSimulation = exports.LoadStrikeScenario = exports.LoadStrikeRunner = exports.LoadStrikeOperationType = exports.LoadStrikeScenarioOperation = exports.LoadStrikeLogLevel = exports.LoadStrikeResponse = exports.LoadStrikeReportFormat = exports.LoadStrikeNodeType = exports.LoadStrikePluginDataTable = exports.LoadStrikePluginData = exports.LoadStrikeContext = exports.ScenarioTrackingExtensions = exports.CrossPlatformScenarioConfigurator = exports.LoadStrikeAutopilotReadiness = exports.LoadStrikeAutopilotResult = exports.LoadStrikeAutopilot = void 0;
4
- exports.TimescaleDbReportingSinkOptions = exports.TimescaleDbReportingSink = exports.SplunkReportingSinkOptions = exports.SplunkReportingSink = void 0;
3
+ exports.InfluxDbReportingSinkOptions = exports.InfluxDbReportingSink = exports.GrafanaLokiReportingSinkOptions = exports.GrafanaLokiReportingSink = exports.DatadogReportingSinkOptions = exports.DatadogReportingSink = exports.HttpAuthOptions = exports.HttpOAuth2ClientCredentialsOptions = exports.PushDiffusionEndpointDefinition = exports.DelegateStreamEndpointDefinition = exports.AzureEventHubsEndpointDefinition = exports.RedisStreamsEndpointDefinition = exports.NatsEndpointDefinition = exports.RabbitMqEndpointDefinition = exports.KafkaSaslOptions = exports.KafkaEndpointDefinition = exports.HttpEndpointDefinition = exports.TrafficEndpointDefinition = exports.LOADSTRIKE_TRACE_ID_TRACKING_FIELD = exports.LOADSTRIKE_TRACE_ID_HEADER = exports.EndpointAdapterFactory = exports.TrackingFieldSelector = exports.TrackingPayloadBuilder = exports.RedisCorrelationStore = exports.RedisCorrelationStoreOptions = exports.InMemoryCorrelationStore = exports.CrossPlatformTrackingRuntime = exports.CorrelationStoreConfiguration = exports.LoadStrikeThreshold = exports.LoadStrikeStep = exports.LoadStrikeGauge = exports.LoadStrikeCounter = exports.LoadStrikeMetric = exports.LoadStrikeSimulation = exports.LoadStrikeScenario = exports.LoadStrikeRunner = exports.LoadStrikeOperationType = exports.LoadStrikeScenarioOperation = exports.LoadStrikeLogLevel = exports.LoadStrikeResponse = exports.LoadStrikeReportFormat = exports.LoadStrikeNodeType = exports.LoadStrikePluginDataTable = exports.LoadStrikePluginData = exports.LoadStrikeContext = exports.ScenarioTrackingExtensions = exports.CrossPlatformScenarioConfigurator = exports.LoadStrikeAutopilotReadiness = exports.LoadStrikeAutopilotResult = exports.LoadStrikeAutopilot = void 0;
4
+ exports.TimescaleDbReportingSinkOptions = exports.TimescaleDbReportingSink = exports.SplunkReportingSinkOptions = exports.SplunkReportingSink = exports.OtelCollectorReportingSinkOptions = exports.OtelCollectorReportingSink = void 0;
5
5
  var autopilot_js_1 = require("./autopilot.js");
6
6
  Object.defineProperty(exports, "LoadStrikeAutopilot", { enumerable: true, get: function () { return autopilot_js_1.LoadStrikeAutopilot; } });
7
7
  Object.defineProperty(exports, "LoadStrikeAutopilotResult", { enumerable: true, get: function () { return autopilot_js_1.LoadStrikeAutopilotResult; } });
@@ -37,6 +37,8 @@ Object.defineProperty(exports, "TrackingPayloadBuilder", { enumerable: true, get
37
37
  Object.defineProperty(exports, "TrackingFieldSelector", { enumerable: true, get: function () { return correlation_js_1.TrackingFieldSelector; } });
38
38
  var transports_js_1 = require("./transports.js");
39
39
  Object.defineProperty(exports, "EndpointAdapterFactory", { enumerable: true, get: function () { return transports_js_1.EndpointAdapterFactory; } });
40
+ Object.defineProperty(exports, "LOADSTRIKE_TRACE_ID_HEADER", { enumerable: true, get: function () { return transports_js_1.LOADSTRIKE_TRACE_ID_HEADER; } });
41
+ Object.defineProperty(exports, "LOADSTRIKE_TRACE_ID_TRACKING_FIELD", { enumerable: true, get: function () { return transports_js_1.LOADSTRIKE_TRACE_ID_TRACKING_FIELD; } });
40
42
  Object.defineProperty(exports, "TrafficEndpointDefinition", { enumerable: true, get: function () { return transports_js_1.TrafficEndpointDefinition; } });
41
43
  Object.defineProperty(exports, "HttpEndpointDefinition", { enumerable: true, get: function () { return transports_js_1.HttpEndpointDefinition; } });
42
44
  Object.defineProperty(exports, "KafkaEndpointDefinition", { enumerable: true, get: function () { return transports_js_1.KafkaEndpointDefinition; } });
package/dist/cjs/local.js CHANGED
@@ -850,10 +850,11 @@ async function evaluateScenarioOutcome(scenario, requestCount, context) {
850
850
  if (!Object.keys(sourceSpec).length) {
851
851
  return { requestCount, okCount: requestCount, failCount: 0 };
852
852
  }
853
- const sourceEndpoint = mapEndpointSpec(sourceSpec);
853
+ const useLoadStrikeTraceIdHeader = toBoolean(pickValue(tracking, "UseLoadStrikeTraceIdHeader", "useLoadStrikeTraceIdHeader"), false);
854
+ const sourceEndpoint = mapEndpointSpec(sourceSpec, useLoadStrikeTraceIdHeader);
854
855
  const destinationSpec = asRecord(tracking.Destination);
855
856
  const hasDestination = Object.keys(destinationSpec).length > 0;
856
- const destinationEndpoint = hasDestination ? mapEndpointSpec(destinationSpec) : null;
857
+ const destinationEndpoint = hasDestination ? mapEndpointSpec(destinationSpec, useLoadStrikeTraceIdHeader) : null;
857
858
  validateTrackingConfiguration(tracking, sourceEndpoint, destinationEndpoint);
858
859
  const sourceAdapter = transports_js_1.EndpointAdapterFactory.create(sourceEndpoint);
859
860
  const destinationAdapter = destinationEndpoint ? transports_js_1.EndpointAdapterFactory.create(destinationEndpoint) : null;
@@ -1109,7 +1110,7 @@ function inferLegacyHttpResponseSourceValue(value) {
1109
1110
  return undefined;
1110
1111
  }
1111
1112
  }
1112
- function mapEndpointSpec(spec) {
1113
+ function mapEndpointSpec(spec, useLoadStrikeTraceIdHeader = false) {
1113
1114
  const pollIntervalOverride = pickValue(spec, "PollIntervalMs", "pollIntervalMs");
1114
1115
  const pollIntervalSeconds = pickValue(spec, "PollIntervalSeconds", "pollIntervalSeconds", "PollInterval");
1115
1116
  const pollIntervalMs = pollIntervalOverride != null && String(pollIntervalOverride).trim() !== ""
@@ -1142,7 +1143,7 @@ function mapEndpointSpec(spec) {
1142
1143
  kind: stringOrDefault(pickValue(spec, "Kind", "kind"), "DelegateStream"),
1143
1144
  mode: stringOrDefault(pickValue(spec, "Mode", "mode"), "Produce"),
1144
1145
  name: stringOrDefault(pickValue(spec, "Name", "name"), "endpoint"),
1145
- trackingField: readTrackingSelectorValue(pickValue(spec, "TrackingField", "trackingField"), "header:x-correlation-id"),
1146
+ trackingField: readTrackingSelectorValue(pickValue(spec, "TrackingField", "trackingField"), useLoadStrikeTraceIdHeader ? transports_js_1.LOADSTRIKE_TRACE_ID_TRACKING_FIELD : "header:x-correlation-id"),
1146
1147
  gatherByField: readOptionalTrackingSelectorValue(pickValue(spec, "GatherByField", "gatherByField")),
1147
1148
  autoGenerateTrackingIdWhenMissing: toBoolean(pickValue(spec, "AutoGenerateTrackingIdWhenMissing", "autoGenerateTrackingIdWhenMissing"), true),
1148
1149
  pollIntervalMs,
@@ -1242,10 +1243,13 @@ function normalizePayload(payload, endpoint, index) {
1242
1243
  return normalized;
1243
1244
  }
1244
1245
  const existing = readTrackingId(normalized, selector);
1245
- if (existing || !endpoint.autoGenerateTrackingIdWhenMissing) {
1246
+ const endpointMode = String(endpoint.mode ?? "Produce").trim().toLowerCase();
1247
+ if (existing || endpointMode === "consume" || !endpoint.autoGenerateTrackingIdWhenMissing) {
1246
1248
  return normalized;
1247
1249
  }
1248
- const generated = `${endpoint.name}-auto-${index + 1}`;
1250
+ const generated = selector.toLowerCase() === transports_js_1.LOADSTRIKE_TRACE_ID_TRACKING_FIELD
1251
+ ? (0, node_crypto_1.randomUUID)()
1252
+ : `${endpoint.name}-auto-${index + 1}`;
1249
1253
  if (selector.toLowerCase().startsWith("header:")) {
1250
1254
  const headerName = selector.slice("header:".length).trim();
1251
1255
  if (headerName) {
@@ -51,6 +51,61 @@ function reportValue(source, ...keys) {
51
51
  }
52
52
  return undefined;
53
53
  }
54
+ function reportDurationValue(source) {
55
+ return reportValue(source, "durationMs", "DurationMs", "duration", "Duration");
56
+ }
57
+ function reportBytesValue(source) {
58
+ return reportValue(source, "allBytes", "AllBytes", "totalBytes", "TotalBytes");
59
+ }
60
+ function reportTotalBytes(nodeStats, scenarios) {
61
+ const totalBytes = asInt(reportBytesValue(nodeStats));
62
+ if (totalBytes !== 0) {
63
+ return totalBytes;
64
+ }
65
+ return scenarios.reduce((sum, scenario) => sum + asInt(reportBytesValue(scenario)), 0);
66
+ }
67
+ function reportRequestCountValue(source) {
68
+ return asInt(reportValue(source, "allRequestCount", "AllRequestCount", "requestCount", "RequestCount"));
69
+ }
70
+ function reportOkCountValue(source) {
71
+ return asInt(reportValue(source, "allOkCount", "AllOkCount", "okCount", "OkCount"));
72
+ }
73
+ function reportFailCountValue(source) {
74
+ return asInt(reportValue(source, "allFailCount", "AllFailCount", "failCount", "FailCount"));
75
+ }
76
+ function reportTotalRequestCount(nodeStats, scenarios) {
77
+ const total = reportRequestCountValue(nodeStats);
78
+ return total !== 0 || scenarios.length === 0
79
+ ? total
80
+ : scenarios.reduce((sum, scenario) => sum + reportRequestCountValue(scenario), 0);
81
+ }
82
+ function reportTotalOkCount(nodeStats, scenarios) {
83
+ const total = reportOkCountValue(nodeStats);
84
+ return total !== 0 || scenarios.length === 0
85
+ ? total
86
+ : scenarios.reduce((sum, scenario) => sum + reportOkCountValue(scenario), 0);
87
+ }
88
+ function reportTotalFailCount(nodeStats, scenarios) {
89
+ const total = reportFailCountValue(nodeStats);
90
+ return total !== 0 || scenarios.length === 0
91
+ ? total
92
+ : scenarios.reduce((sum, scenario) => sum + reportFailCountValue(scenario), 0);
93
+ }
94
+ function reportScenarios(nodeStats) {
95
+ return sortBySortIndex(reportArray(nodeStats, "scenarioStats", "ScenarioStats"));
96
+ }
97
+ function reportSteps(scenario) {
98
+ return sortBySortIndex(reportArray(scenario, "stepStats", "StepStats"));
99
+ }
100
+ function reportThresholds(nodeStats) {
101
+ return reportArray(nodeStats, "thresholds", "Thresholds", "thresholdResults", "ThresholdResults");
102
+ }
103
+ function reportMetrics(nodeStats) {
104
+ return reportObject(nodeStats, "metrics", "Metrics", "metricStats", "MetricStats");
105
+ }
106
+ function reportMetricName(source) {
107
+ return asString(reportValue(source, "metricName", "MetricName", "name", "Name"));
108
+ }
54
109
  function reportObject(source, ...keys) {
55
110
  const value = reportValue(source, ...keys);
56
111
  return value && typeof value === "object" && !Array.isArray(value)
@@ -84,6 +139,16 @@ function asFloat(value) {
84
139
  const parsed = Number.parseFloat(asString(value));
85
140
  return Number.isFinite(parsed) ? parsed : 0;
86
141
  }
142
+ function asBool(value) {
143
+ if (typeof value === "boolean") {
144
+ return value;
145
+ }
146
+ if (typeof value === "number" && Number.isFinite(value)) {
147
+ return value !== 0;
148
+ }
149
+ const normalized = asString(value).trim().toLowerCase();
150
+ return normalized === "1" || normalized === "true" || normalized === "yes" || normalized === "y" || normalized === "on";
151
+ }
87
152
  function formatCellValue(value) {
88
153
  if (value == null) {
89
154
  return "";
@@ -303,7 +368,7 @@ function buildDotnetTableHtml(rows, wrapInCard = true) {
303
368
  appendReportLine(parts, "<table>");
304
369
  appendReportLine(parts, "<thead><tr>");
305
370
  for (const header of headers) {
306
- appendReportLine(parts, `<th>${escapeHtml(header)}</th>`);
371
+ appendReportLine(parts, `<th>${escapeHtml(formatReportTableHeader(header))}</th>`);
307
372
  }
308
373
  appendReportLine(parts, "</tr></thead><tbody>");
309
374
  for (const row of rows) {
@@ -319,6 +384,14 @@ function buildDotnetTableHtml(rows, wrapInCard = true) {
319
384
  }
320
385
  return parts.join("");
321
386
  }
387
+ function formatReportTableHeader(header) {
388
+ if (header === "LatencyStdDev") {
389
+ return "LatencyStdDev (ms)";
390
+ }
391
+ return header.endsWith("Ms") && header.length > "Ms".length
392
+ ? `${header.slice(0, -"Ms".length)} (ms)`
393
+ : header;
394
+ }
322
395
  function buildFailedStatusRows(scenarios) {
323
396
  const rows = [];
324
397
  for (const scenario of scenarios) {
@@ -341,7 +414,7 @@ function buildFailedStatusRows(scenarios) {
341
414
  IsError: isError
342
415
  });
343
416
  }
344
- for (const step of sortBySortIndex(reportArray(scenario, "stepStats", "StepStats"))) {
417
+ for (const step of reportSteps(scenario)) {
345
418
  const stepName = asString(reportValue(step, "stepName", "StepName"));
346
419
  const stepFail = reportObject(step, "fail", "Fail");
347
420
  for (const code of reportArray(stepFail, "statusCodes", "StatusCodes")) {
@@ -593,6 +666,65 @@ function buildMeasurementRow(scope, scenarioName, stepName, resultName, measurem
593
666
  BytesStdDev: formatReportNumber(reportValue(dataTransfer, "stdDev", "StdDev"))
594
667
  };
595
668
  }
669
+ function pushMeasurementRowIfData(rows, scope, scenarioName, stepName, resultName, measurement) {
670
+ if (hasMeasurementData(measurement)) {
671
+ rows.push(buildMeasurementRow(scope, scenarioName, stepName, resultName, measurement));
672
+ }
673
+ }
674
+ function hasMeasurementData(measurement) {
675
+ if (Object.keys(measurement).length === 0) {
676
+ return false;
677
+ }
678
+ const request = reportObject(measurement, "request", "Request");
679
+ if (asInt(reportValue(request, "count", "Count")) !== 0 ||
680
+ asInt(reportValue(request, "percent", "Percent")) !== 0 ||
681
+ asFloat(reportValue(request, "rps", "RPS")) !== 0) {
682
+ return true;
683
+ }
684
+ const latency = reportObject(measurement, "latency", "Latency");
685
+ const latencyKeys = [
686
+ ["minMs", "MinMs"],
687
+ ["meanMs", "MeanMs"],
688
+ ["percent50", "Percent50"],
689
+ ["percent75", "Percent75"],
690
+ ["percent95", "Percent95"],
691
+ ["percent99", "Percent99"],
692
+ ["maxMs", "MaxMs"],
693
+ ["stdDev", "StdDev"]
694
+ ];
695
+ if (latencyKeys.some(([camelKey, pascalKey]) => asFloat(reportValue(latency, camelKey, pascalKey)) !== 0)) {
696
+ return true;
697
+ }
698
+ const latencyCount = reportObject(latency, "latencyCount", "LatencyCount");
699
+ const latencyCountKeys = [
700
+ ["lessOrEq800", "LessOrEq800"],
701
+ ["more800Less1200", "More800Less1200"],
702
+ ["moreOrEq1200", "MoreOrEq1200"]
703
+ ];
704
+ if (latencyCountKeys.some(([camelKey, pascalKey]) => asInt(reportValue(latencyCount, camelKey, pascalKey)) !== 0)) {
705
+ return true;
706
+ }
707
+ const dataTransfer = reportObject(measurement, "dataTransfer", "DataTransfer");
708
+ const dataTransferKeys = [
709
+ ["allBytes", "AllBytes"],
710
+ ["minBytes", "MinBytes"],
711
+ ["meanBytes", "MeanBytes"],
712
+ ["percent50", "Percent50"],
713
+ ["percent75", "Percent75"],
714
+ ["percent95", "Percent95"],
715
+ ["percent99", "Percent99"],
716
+ ["maxBytes", "MaxBytes"],
717
+ ["stdDev", "StdDev"]
718
+ ];
719
+ if (dataTransferKeys.some(([camelKey, pascalKey]) => asFloat(reportValue(dataTransfer, camelKey, pascalKey)) !== 0)) {
720
+ return true;
721
+ }
722
+ return reportArray(measurement, "statusCodes", "StatusCodes").some((code) => asInt(reportValue(code, "count", "Count")) !== 0 ||
723
+ asInt(reportValue(code, "percent", "Percent")) !== 0 ||
724
+ asBool(reportValue(code, "isError", "IsError")) ||
725
+ asString(reportValue(code, "statusCode", "StatusCode")).trim().length > 0 ||
726
+ asString(reportValue(code, "message", "Message")).trim().length > 0);
727
+ }
596
728
  function appendChartCard(parts, id, title) {
597
729
  appendReportLine(parts, `<div class="chart-card"><h3>${escapeHtml(title)}</h3><canvas id="${escapeHtml(id)}" class="chart-canvas"></canvas></div>`);
598
730
  }
@@ -611,24 +743,27 @@ function hasNonEmptyHints(plugin) {
611
743
  return reportArray(plugin, "hints", "Hints").some((hint) => asString(hint).trim().length > 0);
612
744
  }
613
745
  function buildDotnetScenarioRows(nodeStats) {
614
- return sortBySortIndex(reportArray(nodeStats, "scenarioStats", "ScenarioStats")).map((scenario) => ({
615
- Scenario: asString(reportValue(scenario, "scenarioName", "ScenarioName")),
616
- Simulation: asString(reportValue(reportObject(scenario, "loadSimulationStats", "LoadSimulationStats"), "simulationName", "SimulationName")),
617
- SimulationValue: asInt(reportValue(reportObject(scenario, "loadSimulationStats", "LoadSimulationStats"), "value", "Value")),
618
- Requests: asInt(reportValue(scenario, "allRequestCount", "AllRequestCount")),
619
- OK: asInt(reportValue(scenario, "allOkCount", "AllOkCount")),
620
- FAIL: asInt(reportValue(scenario, "allFailCount", "AllFailCount")),
621
- Duration: formatDotnetTimeSpan(reportValue(scenario, "duration", "Duration", "durationMs", "DurationMs")),
622
- RPS: formatReportNumber(reportDurationSeconds(reportValue(scenario, "duration", "Duration", "durationMs", "DurationMs")) <= 0 ? 0 : asInt(reportValue(scenario, "allRequestCount", "AllRequestCount")) / reportDurationSeconds(reportValue(scenario, "duration", "Duration", "durationMs", "DurationMs"))),
623
- LatencyP95Ms: formatReportNumber(Math.max(asFloat(reportValue(reportObject(reportObject(scenario, "ok", "Ok"), "latency", "Latency"), "percent95", "Percent95")), asFloat(reportValue(reportObject(reportObject(scenario, "fail", "Fail"), "latency", "Latency"), "percent95", "Percent95")))),
624
- LatencyP99Ms: formatReportNumber(Math.max(asFloat(reportValue(reportObject(reportObject(scenario, "ok", "Ok"), "latency", "Latency"), "percent99", "Percent99")), asFloat(reportValue(reportObject(reportObject(scenario, "fail", "Fail"), "latency", "Latency"), "percent99", "Percent99")))),
625
- CurrentOperation: asString(reportValue(scenario, "currentOperation", "CurrentOperation"))
626
- }));
746
+ return reportScenarios(nodeStats).map((scenario) => {
747
+ const requestCount = reportRequestCountValue(scenario);
748
+ return {
749
+ Scenario: asString(reportValue(scenario, "scenarioName", "ScenarioName")),
750
+ Simulation: asString(reportValue(reportObject(scenario, "loadSimulationStats", "LoadSimulationStats"), "simulationName", "SimulationName")),
751
+ SimulationValue: asInt(reportValue(reportObject(scenario, "loadSimulationStats", "LoadSimulationStats"), "value", "Value")),
752
+ Requests: requestCount,
753
+ OK: reportOkCountValue(scenario),
754
+ FAIL: reportFailCountValue(scenario),
755
+ Duration: formatDotnetTimeSpan(reportDurationValue(scenario)),
756
+ RPS: formatReportNumber(reportDurationSeconds(reportDurationValue(scenario)) <= 0 ? 0 : requestCount / reportDurationSeconds(reportDurationValue(scenario))),
757
+ LatencyP95Ms: formatReportNumber(Math.max(asFloat(reportValue(reportObject(reportObject(scenario, "ok", "Ok"), "latency", "Latency"), "percent95", "Percent95")), asFloat(reportValue(reportObject(reportObject(scenario, "fail", "Fail"), "latency", "Latency"), "percent95", "Percent95")))),
758
+ LatencyP99Ms: formatReportNumber(Math.max(asFloat(reportValue(reportObject(reportObject(scenario, "ok", "Ok"), "latency", "Latency"), "percent99", "Percent99")), asFloat(reportValue(reportObject(reportObject(scenario, "fail", "Fail"), "latency", "Latency"), "percent99", "Percent99")))),
759
+ CurrentOperation: asString(reportValue(scenario, "currentOperation", "CurrentOperation"))
760
+ };
761
+ });
627
762
  }
628
763
  function buildDotnetStepRows(nodeStats) {
629
764
  const rows = [];
630
- for (const scenario of sortBySortIndex(reportArray(nodeStats, "scenarioStats", "ScenarioStats"))) {
631
- for (const step of sortBySortIndex(reportArray(scenario, "stepStats", "StepStats"))) {
765
+ for (const scenario of reportScenarios(nodeStats)) {
766
+ for (const step of reportSteps(scenario)) {
632
767
  rows.push({
633
768
  Scenario: asString(reportValue(scenario, "scenarioName", "ScenarioName")),
634
769
  Step: asString(reportValue(step, "stepName", "StepName")),
@@ -646,28 +781,28 @@ function buildDotnetStepRows(nodeStats) {
646
781
  }
647
782
  function buildDotnetScenarioMeasurementRows(nodeStats) {
648
783
  const rows = [];
649
- for (const scenario of sortBySortIndex(reportArray(nodeStats, "scenarioStats", "ScenarioStats"))) {
784
+ for (const scenario of reportScenarios(nodeStats)) {
650
785
  const scenarioName = asString(reportValue(scenario, "scenarioName", "ScenarioName"));
651
- rows.push(buildMeasurementRow("Scenario", scenarioName, "", "OK", reportObject(scenario, "ok", "Ok")));
652
- rows.push(buildMeasurementRow("Scenario", scenarioName, "", "FAIL", reportObject(scenario, "fail", "Fail")));
786
+ pushMeasurementRowIfData(rows, "Scenario", scenarioName, "", "OK", reportObject(scenario, "ok", "Ok"));
787
+ pushMeasurementRowIfData(rows, "Scenario", scenarioName, "", "FAIL", reportObject(scenario, "fail", "Fail"));
653
788
  }
654
789
  return rows;
655
790
  }
656
791
  function buildDotnetStepMeasurementRows(nodeStats) {
657
792
  const rows = [];
658
- for (const scenario of sortBySortIndex(reportArray(nodeStats, "scenarioStats", "ScenarioStats"))) {
793
+ for (const scenario of reportScenarios(nodeStats)) {
659
794
  const scenarioName = asString(reportValue(scenario, "scenarioName", "ScenarioName"));
660
- for (const step of sortBySortIndex(reportArray(scenario, "stepStats", "StepStats"))) {
795
+ for (const step of reportSteps(scenario)) {
661
796
  const stepName = asString(reportValue(step, "stepName", "StepName"));
662
- rows.push(buildMeasurementRow("Step", scenarioName, stepName, "OK", reportObject(step, "ok", "Ok")));
663
- rows.push(buildMeasurementRow("Step", scenarioName, stepName, "FAIL", reportObject(step, "fail", "Fail")));
797
+ pushMeasurementRowIfData(rows, "Step", scenarioName, stepName, "OK", reportObject(step, "ok", "Ok"));
798
+ pushMeasurementRowIfData(rows, "Step", scenarioName, stepName, "FAIL", reportObject(step, "fail", "Fail"));
664
799
  }
665
800
  }
666
801
  return rows;
667
802
  }
668
803
  function buildDotnetStatusCodeRows(nodeStats) {
669
804
  const rows = [];
670
- for (const scenario of sortBySortIndex(reportArray(nodeStats, "scenarioStats", "ScenarioStats"))) {
805
+ for (const scenario of reportScenarios(nodeStats)) {
671
806
  const scenarioName = asString(reportValue(scenario, "scenarioName", "ScenarioName"));
672
807
  for (const code of reportArray(reportObject(scenario, "ok", "Ok"), "statusCodes", "StatusCodes")) {
673
808
  rows.push({ Scope: "Scenario", Scenario: scenarioName, Step: "", Result: "OK", StatusCode: asString(reportValue(code, "statusCode", "StatusCode")), Message: asString(reportValue(code, "message", "Message")), Count: asInt(reportValue(code, "count", "Count")), Percent: asInt(reportValue(code, "percent", "Percent")), IsError: Boolean(reportValue(code, "isError", "IsError")) });
@@ -675,7 +810,7 @@ function buildDotnetStatusCodeRows(nodeStats) {
675
810
  for (const code of reportArray(reportObject(scenario, "fail", "Fail"), "statusCodes", "StatusCodes")) {
676
811
  rows.push({ Scope: "Scenario", Scenario: scenarioName, Step: "", Result: "FAIL", StatusCode: asString(reportValue(code, "statusCode", "StatusCode")), Message: asString(reportValue(code, "message", "Message")), Count: asInt(reportValue(code, "count", "Count")), Percent: asInt(reportValue(code, "percent", "Percent")), IsError: Boolean(reportValue(code, "isError", "IsError")) });
677
812
  }
678
- for (const step of sortBySortIndex(reportArray(scenario, "stepStats", "StepStats"))) {
813
+ for (const step of reportSteps(scenario)) {
679
814
  const stepName = asString(reportValue(step, "stepName", "StepName"));
680
815
  for (const code of reportArray(reportObject(step, "ok", "Ok"), "statusCodes", "StatusCodes")) {
681
816
  rows.push({ Scope: "Step", Scenario: scenarioName, Step: stepName, Result: "OK", StatusCode: asString(reportValue(code, "statusCode", "StatusCode")), Message: asString(reportValue(code, "message", "Message")), Count: asInt(reportValue(code, "count", "Count")), Percent: asInt(reportValue(code, "percent", "Percent")), IsError: Boolean(reportValue(code, "isError", "IsError")) });
@@ -688,7 +823,7 @@ function buildDotnetStatusCodeRows(nodeStats) {
688
823
  return rows;
689
824
  }
690
825
  function buildDotnetThresholdRows(nodeStats) {
691
- return reportArray(nodeStats, "thresholds", "Thresholds").map((threshold) => ({
826
+ return reportThresholds(nodeStats).map((threshold) => ({
692
827
  Scenario: asString(reportValue(threshold, "scenarioName", "ScenarioName")),
693
828
  Step: asString(reportValue(threshold, "stepName", "StepName")),
694
829
  Check: asString(reportValue(threshold, "checkExpression", "CheckExpression")),
@@ -698,13 +833,13 @@ function buildDotnetThresholdRows(nodeStats) {
698
833
  }));
699
834
  }
700
835
  function buildDotnetMetricRows(nodeStats) {
701
- const metrics = reportObject(nodeStats, "metrics", "Metrics");
836
+ const metrics = reportMetrics(nodeStats);
702
837
  const rows = [];
703
838
  for (const counter of reportArray(metrics, "counters", "Counters")) {
704
839
  rows.push({
705
840
  Type: "Counter",
706
841
  Scenario: asString(reportValue(counter, "scenarioName", "ScenarioName")),
707
- Name: asString(reportValue(counter, "metricName", "MetricName")),
842
+ Name: reportMetricName(counter),
708
843
  Unit: asString(reportValue(counter, "unitOfMeasure", "UnitOfMeasure")),
709
844
  Value: asInt(reportValue(counter, "value", "Value"))
710
845
  });
@@ -713,7 +848,7 @@ function buildDotnetMetricRows(nodeStats) {
713
848
  rows.push({
714
849
  Type: "Gauge",
715
850
  Scenario: asString(reportValue(gauge, "scenarioName", "ScenarioName")),
716
- Name: asString(reportValue(gauge, "metricName", "MetricName")),
851
+ Name: reportMetricName(gauge),
717
852
  Unit: asString(reportValue(gauge, "unitOfMeasure", "UnitOfMeasure")),
718
853
  Value: formatReportNumber(reportValue(gauge, "value", "Value"))
719
854
  });
@@ -738,15 +873,15 @@ function buildDotnetStatusCodeClassChart(scenarios) {
738
873
  ].filter((entry) => entry.value > 0);
739
874
  }
740
875
  function buildDotnetChartData(nodeStats) {
741
- const scenarios = sortBySortIndex(reportArray(nodeStats, "scenarioStats", "ScenarioStats"));
876
+ const scenarios = reportScenarios(nodeStats);
742
877
  return {
743
878
  overallOutcome: [
744
- { label: "OK", value: asInt(reportValue(nodeStats, "allOkCount", "AllOkCount")), color: "#18a957" },
745
- { label: "FAIL", value: asInt(reportValue(nodeStats, "allFailCount", "AllFailCount")), color: "#d14343" }
879
+ { label: "OK", value: reportTotalOkCount(nodeStats, scenarios), color: "#18a957" },
880
+ { label: "FAIL", value: reportTotalFailCount(nodeStats, scenarios), color: "#d14343" }
746
881
  ],
747
882
  scenarioRequests: scenarios.map((scenario) => ({
748
883
  label: asString(reportValue(scenario, "scenarioName", "ScenarioName")),
749
- value: asInt(reportValue(scenario, "allRequestCount", "AllRequestCount")),
884
+ value: reportRequestCountValue(scenario),
750
885
  color: "#3b82f6"
751
886
  })),
752
887
  scenarioP95Latency: scenarios.map((scenario) => ({
@@ -756,21 +891,21 @@ function buildDotnetChartData(nodeStats) {
756
891
  })),
757
892
  scenarioRps: scenarios.map((scenario) => ({
758
893
  label: asString(reportValue(scenario, "scenarioName", "ScenarioName")),
759
- value: reportDurationSeconds(reportValue(scenario, "duration", "Duration", "durationMs", "DurationMs")) <= 0
894
+ value: reportDurationSeconds(reportDurationValue(scenario)) <= 0
760
895
  ? 0
761
- : asInt(reportValue(scenario, "allRequestCount", "AllRequestCount")) / reportDurationSeconds(reportValue(scenario, "duration", "Duration", "durationMs", "DurationMs")),
896
+ : reportRequestCountValue(scenario) / reportDurationSeconds(reportDurationValue(scenario)),
762
897
  color: "#10b981"
763
898
  })),
764
899
  scenarioFailRate: scenarios.map((scenario) => ({
765
900
  label: asString(reportValue(scenario, "scenarioName", "ScenarioName")),
766
- value: asInt(reportValue(scenario, "allRequestCount", "AllRequestCount")) <= 0
901
+ value: reportRequestCountValue(scenario) <= 0
767
902
  ? 0
768
- : (asInt(reportValue(scenario, "allFailCount", "AllFailCount")) * 100 / asInt(reportValue(scenario, "allRequestCount", "AllRequestCount"))),
903
+ : (reportFailCountValue(scenario) * 100 / reportRequestCountValue(scenario)),
769
904
  color: "#ef4444"
770
905
  })),
771
906
  scenarioBytes: scenarios.map((scenario) => ({
772
907
  label: asString(reportValue(scenario, "scenarioName", "ScenarioName")),
773
- value: asInt(reportValue(scenario, "allBytes", "AllBytes")),
908
+ value: asInt(reportBytesValue(scenario)),
774
909
  color: "#0ea5e9"
775
910
  })),
776
911
  statusCodeClasses: buildDotnetStatusCodeClassChart(scenarios),
@@ -786,21 +921,24 @@ function buildDotnetChartData(nodeStats) {
786
921
  };
787
922
  }
788
923
  function buildDotnetSummaryHtml(nodeStats) {
789
- const scenarios = sortBySortIndex(reportArray(nodeStats, "scenarioStats", "ScenarioStats"));
790
- const successRate = asInt(reportValue(nodeStats, "allRequestCount", "AllRequestCount")) <= 0
924
+ const scenarios = reportScenarios(nodeStats);
925
+ const allRequests = reportTotalRequestCount(nodeStats, scenarios);
926
+ const allOk = reportTotalOkCount(nodeStats, scenarios);
927
+ const allFail = reportTotalFailCount(nodeStats, scenarios);
928
+ const successRate = allRequests <= 0
791
929
  ? 0
792
- : (asInt(reportValue(nodeStats, "allOkCount", "AllOkCount")) * 100 / asInt(reportValue(nodeStats, "allRequestCount", "AllRequestCount")));
793
- const failRate = asInt(reportValue(nodeStats, "allRequestCount", "AllRequestCount")) <= 0
930
+ : (allOk * 100 / allRequests);
931
+ const failRate = allRequests <= 0
794
932
  ? 0
795
- : (asInt(reportValue(nodeStats, "allFailCount", "AllFailCount")) * 100 / asInt(reportValue(nodeStats, "allRequestCount", "AllRequestCount")));
796
- const overallRps = reportDurationSeconds(reportValue(nodeStats, "duration", "Duration", "durationMs", "DurationMs")) <= 0
933
+ : (allFail * 100 / allRequests);
934
+ const overallRps = reportDurationSeconds(reportDurationValue(nodeStats)) <= 0
797
935
  ? 0
798
- : asInt(reportValue(nodeStats, "allRequestCount", "AllRequestCount")) / reportDurationSeconds(reportValue(nodeStats, "duration", "Duration", "durationMs", "DurationMs"));
936
+ : allRequests / reportDurationSeconds(reportDurationValue(nodeStats));
799
937
  const topScenario = scenarios.reduce((winner, scenario) => {
800
938
  if (!winner) {
801
939
  return scenario;
802
940
  }
803
- return asInt(reportValue(scenario, "allRequestCount", "AllRequestCount")) > asInt(reportValue(winner, "allRequestCount", "AllRequestCount"))
941
+ return reportRequestCountValue(scenario) > reportRequestCountValue(winner)
804
942
  ? scenario
805
943
  : winner;
806
944
  }, undefined);
@@ -811,14 +949,15 @@ function buildDotnetSummaryHtml(nodeStats) {
811
949
  const chartData = buildDotnetChartData(nodeStats);
812
950
  const testInfo = reportObject(nodeStats, "testInfo", "TestInfo");
813
951
  const nodeInfo = reportObject(nodeStats, "nodeInfo", "NodeInfo");
952
+ const totalBytes = reportTotalBytes(nodeStats, scenarios);
814
953
  const parts = [];
815
954
  appendReportLine(parts, "<div class=\"card-grid\">");
816
- appendReportLine(parts, `<div class="stat-card"><div class="stat-label">Total Requests</div><div class="stat-value">${asInt(reportValue(nodeStats, "allRequestCount", "AllRequestCount"))}</div></div>`);
817
- appendReportLine(parts, `<div class="stat-card"><div class="stat-label">Success</div><div class="stat-value value-ok">${asInt(reportValue(nodeStats, "allOkCount", "AllOkCount"))} (${formatDotnetPercent(successRate)}%)</div></div>`);
818
- appendReportLine(parts, `<div class="stat-card"><div class="stat-label">Fail</div><div class="stat-value value-fail">${asInt(reportValue(nodeStats, "allFailCount", "AllFailCount"))} (${formatDotnetPercent(failRate)}%)</div></div>`);
955
+ appendReportLine(parts, `<div class="stat-card"><div class="stat-label">Total Requests</div><div class="stat-value">${allRequests}</div></div>`);
956
+ appendReportLine(parts, `<div class="stat-card"><div class="stat-label">Success</div><div class="stat-value value-ok">${allOk} (${formatDotnetPercent(successRate)}%)</div></div>`);
957
+ appendReportLine(parts, `<div class="stat-card"><div class="stat-label">Fail</div><div class="stat-value value-fail">${allFail} (${formatDotnetPercent(failRate)}%)</div></div>`);
819
958
  appendReportLine(parts, `<div class="stat-card"><div class="stat-label">Overall RPS</div><div class="stat-value">${formatReportNumber(overallRps)}</div></div>`);
820
- appendReportLine(parts, `<div class="stat-card"><div class="stat-label">Duration</div><div class="stat-value">${escapeHtml(formatDotnetTimeSpan(reportValue(nodeStats, "duration", "Duration", "durationMs", "DurationMs")))}</div></div>`);
821
- appendReportLine(parts, `<div class="stat-card"><div class="stat-label">Total Bytes</div><div class="stat-value">${asInt(reportValue(nodeStats, "allBytes", "AllBytes"))}</div></div>`);
959
+ appendReportLine(parts, `<div class="stat-card"><div class="stat-label">Duration</div><div class="stat-value">${escapeHtml(formatDotnetTimeSpan(reportDurationValue(nodeStats)))}</div></div>`);
960
+ appendReportLine(parts, `<div class="stat-card"><div class="stat-label">Total Bytes</div><div class="stat-value">${totalBytes}</div></div>`);
822
961
  appendReportLine(parts, `<div class="stat-card"><div class="stat-label">Top Scenario</div><div class="stat-value">${escapeHtml(topScenario ? reportValue(topScenario, "scenarioName", "ScenarioName") : "n/a")}</div></div>`);
823
962
  appendReportLine(parts, `<div class="stat-card"><div class="stat-label">Node</div><div class="stat-value">${loadStrikeNodeTypeTag(reportValue(nodeInfo, "nodeType", "NodeType"))}</div></div>`);
824
963
  appendReportLine(parts, "</div>");
@@ -893,7 +1032,7 @@ function buildDotnetStatusCodeHtml(nodeStats) {
893
1032
  return buildDotnetTableHtml(buildDotnetStatusCodeRows(nodeStats));
894
1033
  }
895
1034
  function buildDotnetFailedResponseHtml(nodeStats) {
896
- const failedStatusRows = buildFailedStatusRows(sortBySortIndex(reportArray(nodeStats, "scenarioStats", "ScenarioStats")));
1035
+ const failedStatusRows = buildFailedStatusRows(reportScenarios(nodeStats));
897
1036
  const failedEventRows = buildFailedEventRows(reportArray(nodeStats, "pluginsData", "PluginsData"));
898
1037
  return buildDotnetFailedResponseContent(failedStatusRows, failedEventRows);
899
1038
  }
@@ -984,7 +1123,7 @@ function buildDotnetHtmlTabs(nodeStats) {
984
1123
  if (statusCodeRows.length) {
985
1124
  tabs.push(["status-codes", "Status Codes", buildDotnetTableHtml(statusCodeRows)]);
986
1125
  }
987
- const failedStatusRows = buildFailedStatusRows(sortBySortIndex(reportArray(nodeStats, "scenarioStats", "ScenarioStats")));
1126
+ const failedStatusRows = buildFailedStatusRows(reportScenarios(nodeStats));
988
1127
  const failedEventRows = buildFailedEventRows(reportArray(nodeStats, "pluginsData", "PluginsData"));
989
1128
  if (failedStatusRows.length || failedEventRows.length) {
990
1129
  tabs.push(["failed-responses", "Failed Responses", buildDotnetFailedResponseContent(failedStatusRows, failedEventRows)]);
@@ -1042,7 +1181,7 @@ function buildDotnetHtmlTabs(nodeStats) {
1042
1181
  * Exposes the build dotnet txt report operation. Use this when interacting with the SDK through this surface.
1043
1182
  */
1044
1183
  function buildDotnetTxtReport(nodeStats) {
1045
- const scenarios = sortBySortIndex(reportArray(nodeStats, "scenarioStats", "ScenarioStats"));
1184
+ const scenarios = reportScenarios(nodeStats);
1046
1185
  const testInfo = reportObject(nodeStats, "testInfo", "TestInfo");
1047
1186
  const nodeInfo = reportObject(nodeStats, "nodeInfo", "NodeInfo");
1048
1187
  const lines = [
@@ -1050,25 +1189,25 @@ function buildDotnetTxtReport(nodeStats) {
1050
1189
  `TestName: ${asString(reportValue(testInfo, "testName", "TestName"))}`,
1051
1190
  `SessionId: ${asString(reportValue(testInfo, "sessionId", "SessionId"))}`,
1052
1191
  `NodeType: ${loadStrikeNodeTypeTag(reportValue(nodeInfo, "nodeType", "NodeType"))}`,
1053
- `Duration: ${formatDotnetTimeSpan(reportValue(nodeStats, "duration", "Duration", "durationMs", "DurationMs"))}`,
1054
- `Requests: ${asInt(reportValue(nodeStats, "allRequestCount", "AllRequestCount"))} OK: ${asInt(reportValue(nodeStats, "allOkCount", "AllOkCount"))} FAIL: ${asInt(reportValue(nodeStats, "allFailCount", "AllFailCount"))}`,
1192
+ `Duration: ${formatDotnetTimeSpan(reportDurationValue(nodeStats))}`,
1193
+ `Requests: ${reportTotalRequestCount(nodeStats, scenarios)} OK: ${reportTotalOkCount(nodeStats, scenarios)} FAIL: ${reportTotalFailCount(nodeStats, scenarios)}`,
1055
1194
  "",
1056
1195
  "Scenarios:"
1057
1196
  ];
1058
1197
  for (const scenario of scenarios) {
1059
- lines.push(`- ${asString(reportValue(scenario, "scenarioName", "ScenarioName"))}: req=${asInt(reportValue(scenario, "allRequestCount", "AllRequestCount"))} ok=${asInt(reportValue(scenario, "allOkCount", "AllOkCount"))} fail=${asInt(reportValue(scenario, "allFailCount", "AllFailCount"))} duration=${formatDotnetTimeSpan(reportValue(scenario, "duration", "Duration", "durationMs", "DurationMs"))}`);
1198
+ lines.push(`- ${asString(reportValue(scenario, "scenarioName", "ScenarioName"))}: req=${reportRequestCountValue(scenario)} ok=${reportOkCountValue(scenario)} fail=${reportFailCountValue(scenario)} duration=${formatDotnetTimeSpan(reportDurationValue(scenario))}`);
1060
1199
  }
1061
- if (scenarios.some((scenario) => reportArray(scenario, "stepStats", "StepStats").length > 0)) {
1200
+ if (scenarios.some((scenario) => reportSteps(scenario).length > 0)) {
1062
1201
  lines.push("", "Steps:");
1063
1202
  for (const scenario of scenarios) {
1064
- for (const step of sortBySortIndex(reportArray(scenario, "stepStats", "StepStats"))) {
1203
+ for (const step of reportSteps(scenario)) {
1065
1204
  const ok = asInt(reportValue(reportObject(reportObject(step, "ok", "Ok"), "request", "Request"), "count", "Count"));
1066
1205
  const fail = asInt(reportValue(reportObject(reportObject(step, "fail", "Fail"), "request", "Request"), "count", "Count"));
1067
1206
  lines.push(`- ${asString(reportValue(scenario, "scenarioName", "ScenarioName"))}.${asString(reportValue(step, "stepName", "StepName"))}: req=${ok + fail} ok=${ok} fail=${fail}`);
1068
1207
  }
1069
1208
  }
1070
1209
  }
1071
- const thresholds = reportArray(nodeStats, "thresholds", "Thresholds");
1210
+ const thresholds = reportThresholds(nodeStats);
1072
1211
  if (thresholds.length) {
1073
1212
  lines.push("", "Thresholds:");
1074
1213
  for (const threshold of thresholds) {
@@ -1092,10 +1231,10 @@ function buildDotnetTxtReport(nodeStats) {
1092
1231
  */
1093
1232
  function buildDotnetCsvReport(nodeStats) {
1094
1233
  const lines = ["ScenarioName,Requests,Ok,Fail,DurationSeconds,Rps"];
1095
- for (const scenario of sortBySortIndex(reportArray(nodeStats, "scenarioStats", "ScenarioStats"))) {
1096
- const durationSeconds = reportDurationSeconds(reportValue(scenario, "duration", "Duration", "durationMs", "DurationMs"));
1097
- const requests = asInt(reportValue(scenario, "allRequestCount", "AllRequestCount"));
1098
- lines.push(`${escapeCsv(reportValue(scenario, "scenarioName", "ScenarioName"))},${requests},${asInt(reportValue(scenario, "allOkCount", "AllOkCount"))},${asInt(reportValue(scenario, "allFailCount", "AllFailCount"))},${formatReportNumber(durationSeconds)},${formatReportNumber(durationSeconds <= 0 ? 0 : requests / durationSeconds)}`);
1234
+ for (const scenario of reportScenarios(nodeStats)) {
1235
+ const durationSeconds = reportDurationSeconds(reportDurationValue(scenario));
1236
+ const requests = reportRequestCountValue(scenario);
1237
+ lines.push(`${escapeCsv(reportValue(scenario, "scenarioName", "ScenarioName"))},${requests},${reportOkCountValue(scenario)},${reportFailCountValue(scenario)},${formatReportNumber(durationSeconds)},${formatReportNumber(durationSeconds <= 0 ? 0 : requests / durationSeconds)}`);
1099
1238
  }
1100
1239
  return reportLines(lines);
1101
1240
  }
@@ -1103,16 +1242,16 @@ function buildDotnetCsvReport(nodeStats) {
1103
1242
  * Exposes the build dotnet markdown report operation. Use this when interacting with the SDK through this surface.
1104
1243
  */
1105
1244
  function buildDotnetMarkdownReport(nodeStats) {
1106
- const scenarios = sortBySortIndex(reportArray(nodeStats, "scenarioStats", "ScenarioStats"));
1245
+ const scenarios = reportScenarios(nodeStats);
1107
1246
  const testInfo = reportObject(nodeStats, "testInfo", "TestInfo");
1108
1247
  const lines = [
1109
1248
  `# ${asString(reportValue(testInfo, "testSuite", "TestSuite"))} / ${asString(reportValue(testInfo, "testName", "TestName"))}`,
1110
1249
  "",
1111
1250
  `- Session: \`${asString(reportValue(testInfo, "sessionId", "SessionId"))}\``,
1112
- `- Duration: \`${formatDotnetTimeSpan(reportValue(nodeStats, "duration", "Duration", "durationMs", "DurationMs"))}\``,
1113
- `- Total Requests: \`${asInt(reportValue(nodeStats, "allRequestCount", "AllRequestCount"))}\``,
1114
- `- OK: \`${asInt(reportValue(nodeStats, "allOkCount", "AllOkCount"))}\``,
1115
- `- FAIL: \`${asInt(reportValue(nodeStats, "allFailCount", "AllFailCount"))}\``,
1251
+ `- Duration: \`${formatDotnetTimeSpan(reportDurationValue(nodeStats))}\``,
1252
+ `- Total Requests: \`${reportTotalRequestCount(nodeStats, scenarios)}\``,
1253
+ `- OK: \`${reportTotalOkCount(nodeStats, scenarios)}\``,
1254
+ `- FAIL: \`${reportTotalFailCount(nodeStats, scenarios)}\``,
1116
1255
  "",
1117
1256
  "## Scenarios",
1118
1257
  "",
@@ -1120,19 +1259,19 @@ function buildDotnetMarkdownReport(nodeStats) {
1120
1259
  "|---|---:|---:|---:|---:|"
1121
1260
  ];
1122
1261
  for (const scenario of scenarios) {
1123
- lines.push(`| ${asString(reportValue(scenario, "scenarioName", "ScenarioName"))} | ${asInt(reportValue(scenario, "allRequestCount", "AllRequestCount"))} | ${asInt(reportValue(scenario, "allOkCount", "AllOkCount"))} | ${asInt(reportValue(scenario, "allFailCount", "AllFailCount"))} | ${formatReportNumber(reportDurationSeconds(reportValue(scenario, "duration", "Duration", "durationMs", "DurationMs")))}s |`);
1262
+ lines.push(`| ${asString(reportValue(scenario, "scenarioName", "ScenarioName"))} | ${reportRequestCountValue(scenario)} | ${reportOkCountValue(scenario)} | ${reportFailCountValue(scenario)} | ${formatReportNumber(reportDurationSeconds(reportDurationValue(scenario)))}s |`);
1124
1263
  }
1125
- if (scenarios.some((scenario) => reportArray(scenario, "stepStats", "StepStats").length > 0)) {
1264
+ if (scenarios.some((scenario) => reportSteps(scenario).length > 0)) {
1126
1265
  lines.push("", "## Steps", "", "| Scenario | Step | Requests | OK | FAIL |", "|---|---|---:|---:|---:|");
1127
1266
  for (const scenario of scenarios) {
1128
- for (const step of sortBySortIndex(reportArray(scenario, "stepStats", "StepStats"))) {
1267
+ for (const step of reportSteps(scenario)) {
1129
1268
  const ok = asInt(reportValue(reportObject(reportObject(step, "ok", "Ok"), "request", "Request"), "count", "Count"));
1130
1269
  const fail = asInt(reportValue(reportObject(reportObject(step, "fail", "Fail"), "request", "Request"), "count", "Count"));
1131
1270
  lines.push(`| ${asString(reportValue(scenario, "scenarioName", "ScenarioName"))} | ${asString(reportValue(step, "stepName", "StepName"))} | ${ok + fail} | ${ok} | ${fail} |`);
1132
1271
  }
1133
1272
  }
1134
1273
  }
1135
- const thresholds = reportArray(nodeStats, "thresholds", "Thresholds");
1274
+ const thresholds = reportThresholds(nodeStats);
1136
1275
  if (thresholds.length) {
1137
1276
  lines.push("", "## Thresholds", "", "| Scenario | Step | Check | Failed | Errors | Exception |", "|---|---|---|---:|---:|---|");
1138
1277
  for (const threshold of thresholds) {
@@ -1268,7 +1407,7 @@ if(btns.length>0){show(btns[0].dataset.tab);}renderAllCharts();initPanePan();win
1268
1407
  .split("__TEST_SUITE__").join(escapeHtml(reportValue(testInfo, "testSuite", "TestSuite")))
1269
1408
  .split("__TEST_NAME__").join(escapeHtml(reportValue(testInfo, "testName", "TestName")))
1270
1409
  .split("__SESSION_ID__").join(escapeHtml(reportValue(testInfo, "sessionId", "SessionId")))
1271
- .split("__DURATION__").join(escapeHtml(formatDotnetTimeSpan(reportValue(nodeStats, "duration", "Duration", "durationMs", "DurationMs"))))
1410
+ .split("__DURATION__").join(escapeHtml(formatDotnetTimeSpan(reportDurationValue(nodeStats))))
1272
1411
  .split("__BUTTONS__").join(buttonsHtml)
1273
1412
  .split("__SECTIONS__").join(sectionsHtml)
1274
1413
  .split("__CHART_DATA__").join(chartDataJson)