@@ -34,14 +34,14 @@ let getFinalScenarioStats (schedulers: ScenarioScheduler list) =
3434 |> List.map( fun x -> x.GetFinalStats())
3535 |> Task.WhenAll
3636
37- let getPluginStats ( dep : IGlobalDependency ) ( operation : OperationType ) = backgroundTask {
37+ let getPluginStats ( dep : IGlobalDependency ) ( stats : NodeStats ) = backgroundTask {
3838 try
3939 let pluginStatusesTask =
4040 dep.WorkerPlugins
41- |> List.map( fun plugin -> plugin.GetStats operation )
41+ |> List.map( fun plugin -> plugin.GetStats stats )
4242 |> Task.WhenAll
4343
44- let! finishedTask = Task.WhenAny( pluginStatusesTask, Task.Delay( Constants.GetPluginStatsTimeout) )
44+ let! finishedTask = Task.WhenAny( pluginStatusesTask, Task.Delay Constants.GetPluginStatsTimeout)
4545 if finishedTask.Id = pluginStatusesTask.Id then return pluginStatusesTask.Result
4646 else
4747 dep.Logger.Error( " Getting plugin stats failed with the timeout error" )
@@ -57,12 +57,13 @@ let getFinalStats (dep: IGlobalDependency)
5757 ( testInfo : TestInfo )
5858 ( nodeInfo : NodeInfo ) = backgroundTask {
5959
60- let pluginStats = getPluginStats dep nodeInfo.CurrentOperation
61- let scenarioStats = getFinalScenarioStats schedulers
62- do ! Task.WhenAll( pluginStats, scenarioStats)
60+ let! scenarioStats = getFinalScenarioStats schedulers
6361
64- return if Array.isEmpty scenarioStats.Result then None
65- else Some( NodeStats.create testInfo nodeInfo scenarioStats.Result pluginStats.Result)
62+ if Array.isEmpty scenarioStats then return None
63+ else
64+ let nodeStats = NodeStats.create testInfo nodeInfo scenarioStats
65+ let! pluginStats = getPluginStats dep nodeStats
66+ return Some { nodeStats with PluginStats = pluginStats }
6667}
6768
6869type ActorMessage =
@@ -104,7 +105,7 @@ type TestHostReportingActor(dep: IGlobalDependency, schedulers: ScenarioSchedule
104105 |> TaskOption.map( NodeStats.round >> reply.TrySetResult)
105106 |> Task.WaitAll
106107 with
107- | ex -> dep.Logger.Error( ex , " TestHostReporting actor failed" )
108+ | ex -> dep.Logger.Error( " TestHostReporting actor failed: {0} " , ex.ToString () )
108109 }
109110 :> Task
110111 )
0 commit comments