mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-09 20:41:10 +00:00
Improved performance benefit calculation and error message
This commit is contained in:
1 parent
e141f30df7
commit
6bbbbdb3a9
1 file changed
+5
-2
+5
-2
@@ -130,11 +130,14 @@ public class IncrementalManeuverComputationTest extends AbstractManeuverDetectio
|
||||
performanceMeasurementStartedAt = System.currentTimeMillis();
|
||||
List<Maneuver> normallyDetectedManeuvers = normalManeuverDetector.detectManeuvers();
|
||||
long millisForNormalManeuverDetection = System.currentTimeMillis() - performanceMeasurementStartedAt;
|
||||
int performanceBenefitOfIncrementalManeuverDetectionInPercent = (int) ((1.0 * (millisForNormalManeuverDetection - millisForIncrementalManeuverDetection)
|
||||
/ millisForNormalManeuverDetection) * 100);
|
||||
assertEquals("Incrementally calculated maneuvers differ from normally calculated maneuvers",
|
||||
normallyDetectedManeuvers, incrementallyDetectedManeuvers);
|
||||
assertTrue(
|
||||
"Incremental maneuver detection was not 20% faster in detecting maneuvers incrementally, than the full maneuver detection",
|
||||
millisForIncrementalManeuverDetection * 1.2 < millisForNormalManeuverDetection);
|
||||
"Incremental maneuver detection was not 20% faster in detecting maneuvers incrementally, than the full maneuver detection. The actual performance benefit was: "
|
||||
+ performanceBenefitOfIncrementalManeuverDetectionInPercent + "%",
|
||||
performanceBenefitOfIncrementalManeuverDetectionInPercent >= 20);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user