From 0fbc06cadbcef1c436d88162a874e21dd9903713 Mon Sep 17 00:00:00 2001 From: antyadev Date: Thu, 3 Oct 2024 09:36:23 +0300 Subject: [PATCH] cosmetic changes --- src/NBomber.Contracts/Contracts.fs | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/NBomber.Contracts/Contracts.fs b/src/NBomber.Contracts/Contracts.fs index bd92c58..c90bc1d 100644 --- a/src/NBomber.Contracts/Contracts.fs +++ b/src/NBomber.Contracts/Contracts.fs @@ -329,11 +329,13 @@ type ScenarioProps = { Weight: int option } +/// Provides details about the Scenario that is scheduled to start. type ScenarioStartInfo = { ScenarioName: string SortIndex: int } +/// Provides session details about the Scenarios that are scheduled to start. type SessionStartInfo = { Scenarios: ScenarioStartInfo[] } @@ -354,7 +356,7 @@ type IReportingSink = /// /// Starts execution, signifying the START event of the load test session. /// - /// Represent session information about startup Scenarios + /// Provides session details about the Scenarios that are scheduled to start abstract Start: sessionInfo:SessionStartInfo -> Task /// @@ -395,7 +397,7 @@ type IWorkerPlugin = /// /// Starts execution, signifying the START event of the load test session. /// - /// Represent session information about startup Scenarios + /// Provides session details about the Scenarios that are scheduled to start abstract Start: sessionInfo:SessionStartInfo -> Task abstract GetStats: stats:NodeStats -> Task @@ -414,32 +416,26 @@ type ApplicationType = type StatsExtensions() = static let rec findStatus (stats: StatusCodeStats[]) (code: string) (index: int) = - if stats.Length = 0 then + if index >= stats.Length then ValueNone elif stats[index].StatusCode = code then - ValueSome stats[index] - elif index >= stats.Length - 1 then - ValueNone + ValueSome stats[index] else findStatus stats code (index + 1) static let rec findScenario (stats: ScenarioStats[]) (name: string) (index: int) = - if stats.Length = 0 then + if index >= stats.Length then ValueNone elif stats[index].ScenarioName = name then - ValueSome stats[index] - elif index >= stats.Length - 1 then - ValueNone + ValueSome stats[index] else findScenario stats name (index + 1) static let rec findStep (stats: StepStats[]) (name: string) (index: int) = - if stats.Length = 0 then + if index >= stats.Length then ValueNone elif stats[index].StepName = name then - ValueSome stats[index] - elif index >= stats.Length - 1 then - ValueNone + ValueSome stats[index] else findStep stats name (index + 1)