Skip to content
This repository has been archived by the owner on Aug 31, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinmoris committed Nov 9, 2021
2 parents 10d5758 + 34625bf commit 7814786
Showing 1 changed file with 27 additions and 21 deletions.
48 changes: 27 additions & 21 deletions src/BuildStats/BuildHistoryCharts.fs
Original file line number Diff line number Diff line change
Expand Up @@ -55,31 +55,37 @@ module BuildMetrics =
open System

let longestBuildTime (builds : Build list) =
match builds.Length with
| 0 -> TimeSpan.Zero
| _ ->
builds
|> List.filter (fun b -> b.Status = Success)
|> List.maxBy (fun x -> x.TimeTaken.TotalMilliseconds)
|> fun x -> x.TimeTaken
builds
|> List.filter (fun b -> b.Status = Success)
|> fun builds ->
match builds.Length with
| 0 -> TimeSpan.Zero
| _ ->
builds
|> List.maxBy (fun x -> x.TimeTaken.TotalMilliseconds)
|> fun x -> x.TimeTaken

let shortestBuildTime (builds : Build list) =
match builds.Length with
| 0 -> TimeSpan.Zero
| _ ->
builds
|> List.filter (fun b -> b.Status = Success)
|> List.minBy (fun x -> x.TimeTaken.TotalMilliseconds)
|> fun x -> x.TimeTaken
builds
|> List.filter (fun b -> b.Status = Success)
|> fun builds ->
match builds.Length with
| 0 -> TimeSpan.Zero
| _ ->
builds
|> List.minBy (fun x -> x.TimeTaken.TotalMilliseconds)
|> fun x -> x.TimeTaken

let averageBuildTime (builds : Build list) =
match builds.Length with
| 0 -> TimeSpan.Zero
| _ ->
builds
|> List.filter (fun b -> b.Status = Success)
|> List.averageBy (fun x -> x.TimeTaken.TotalMilliseconds)
|> TimeSpan.FromMilliseconds
builds
|> List.filter (fun b -> b.Status = Success)
|> fun builds ->
match builds.Length with
| 0 -> TimeSpan.Zero
| _ ->
builds
|> List.averageBy (fun x -> x.TimeTaken.TotalMilliseconds)
|> TimeSpan.FromMilliseconds

// -------------------------------------------
// CI HTTP Clients
Expand Down

0 comments on commit 7814786

Please sign in to comment.