Skip to content

Instantly share code, notes, and snippets.

@Malinskiy
Created March 6, 2019 16:22
Show Gist options
  • Save Malinskiy/e7744f5096a48ecdf90986458fc9b9f1 to your computer and use it in GitHub Desktop.
Save Malinskiy/e7744f5096a48ecdf90986458fc9b9f1 to your computer and use it in GitHub Desktop.
class ExecutionTimeSortingStrategy(val percentile: Double,
val timeLimit: Instant) : SortingStrategy {
override fun process(metricsProvider: MetricsProvider): Comparator<Test> =
Comparator.comparingDouble<Test> {
val expectedDuration = metricsProvider.executionTime(it, percentile, timeLimit)
expectedDuration
}.reversed()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment