- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for percentChange (0.29 sec)
-
testing/internal-performance-testing/src/test/groovy/org/gradle/performance/fixture/PrettyCalculatorSpec.groovy
import org.gradle.performance.measure.Duration import spock.lang.Specification import static org.gradle.performance.results.PrettyCalculator.percentChange class PrettyCalculatorSpec extends Specification { def "knows percentage change"() { expect: percentChange(Amount.valueOf(current, Duration.SECONDS), Amount.valueOf(previous, Duration.SECONDS)) == percent where: current | previous | percent
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Thu Apr 04 07:21:38 UTC 2024 - 1.5K bytes - Viewed (0) -
testing/internal-performance-testing/src/main/groovy/org/gradle/performance/results/PrettyCalculator.groovy
static String toMillis(Amount<Duration> duration) { return duration.toUnits(Duration.MILLI_SECONDS).value.setScale(3, RoundingMode.HALF_UP).stripTrailingZeros().toString() + " ms" } static <Q> Number percentChange(Amount<Q> current, Amount<Q> previous) { if (previous == Amount.valueOf(0, previous.getUnits())) { return 100 as Integer } BigDecimal result = (current - previous) / previous * 100
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Thu Apr 04 07:21:38 UTC 2024 - 1.6K bytes - Viewed (0) -
testing/internal-performance-testing/src/main/groovy/org/gradle/performance/results/BaselineVersion.groovy
def desc = diff > Duration.millis(0) ? "slower" : "faster" sb.append("Difference: ${diff.abs().format()} $desc (${toMillis(diff.abs())}), ${PrettyCalculator.percentChange(currentVersionMean, thisVersionMean)}%\n") sb.append(current.speedStats) sb.append(results.speedStats) sb.append("\n") sb.toString() } else {
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Thu Apr 04 07:21:38 UTC 2024 - 5.6K bytes - Viewed (0)