@@ -55,31 +55,37 @@ module BuildMetrics =
5555 open System
5656
5757 let longestBuildTime ( builds : Build list ) =
58- match builds.Length with
59- | 0 -> TimeSpan.Zero
60- | _ ->
61- builds
62- |> List.filter ( fun b -> b.Status = Success)
63- |> List.maxBy ( fun x -> x.TimeTaken.TotalMilliseconds)
64- |> fun x -> x.TimeTaken
58+ builds
59+ |> List.filter ( fun b -> b.Status = Success)
60+ |> fun builds ->
61+ match builds.Length with
62+ | 0 -> TimeSpan.Zero
63+ | _ ->
64+ builds
65+ |> List.maxBy ( fun x -> x.TimeTaken.TotalMilliseconds)
66+ |> fun x -> x.TimeTaken
6567
6668 let shortestBuildTime ( builds : Build list ) =
67- match builds.Length with
68- | 0 -> TimeSpan.Zero
69- | _ ->
70- builds
71- |> List.filter ( fun b -> b.Status = Success)
72- |> List.minBy ( fun x -> x.TimeTaken.TotalMilliseconds)
73- |> fun x -> x.TimeTaken
69+ builds
70+ |> List.filter ( fun b -> b.Status = Success)
71+ |> fun builds ->
72+ match builds.Length with
73+ | 0 -> TimeSpan.Zero
74+ | _ ->
75+ builds
76+ |> List.minBy ( fun x -> x.TimeTaken.TotalMilliseconds)
77+ |> fun x -> x.TimeTaken
7478
7579 let averageBuildTime ( builds : Build list ) =
76- match builds.Length with
77- | 0 -> TimeSpan.Zero
78- | _ ->
79- builds
80- |> List.filter ( fun b -> b.Status = Success)
81- |> List.averageBy ( fun x -> x.TimeTaken.TotalMilliseconds)
82- |> TimeSpan.FromMilliseconds
80+ builds
81+ |> List.filter ( fun b -> b.Status = Success)
82+ |> fun builds ->
83+ match builds.Length with
84+ | 0 -> TimeSpan.Zero
85+ | _ ->
86+ builds
87+ |> List.averageBy ( fun x -> x.TimeTaken.TotalMilliseconds)
88+ |> TimeSpan.FromMilliseconds
8389
8490// -------------------------------------------
8591// CI HTTP Clients
0 commit comments