Package org.qubership.atp.ram.utils
Class RateCalculator
java.lang.Object
org.qubership.atp.ram.utils.RateCalculator
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcalculateErRates(ExecutionRequest executionRequest, List<TestRun> allTestRuns) Calculate rates for stopped ER.static floatcalculateRateFloat(int part, int total) Calculates what percent 'part' is of 'total'.static intcalculateRateInt(int part, int total) Calculates what percent 'part' is of 'total'.voidcalculateRates(ExecutionRequest executionRequest, List<TestRun> allTestRuns) Calculate rates for stopped ER.calculateTestRunsTestingStatusStats(ExecutionRequest executionRequest, List<TestRun> testRuns) Calculate tets runs testing status stats.booleanisTestRunIgnoredByFlag(TestRun testRun, Set<UUID> flagIds, List<UUID> prerequisitesCases, List<UUID> validationCases) Checks if result of test run should be counted.
-
Constructor Details
-
RateCalculator
public RateCalculator()
-
-
Method Details
-
calculateRates
Calculate rates for stopped ER. -
isTestRunIgnoredByFlag
public boolean isTestRunIgnoredByFlag(TestRun testRun, Set<UUID> flagIds, List<UUID> prerequisitesCases, List<UUID> validationCases) Checks if result of test run should be counted.- Parameters:
testRun- checked test runflagIds- flags of the execution requestprerequisitesCases- uuids of prerequisite casesvalidationCases- uuids of validation cases- Returns:
- true if test run should not be counted due to set of ignore flag
-
calculateErRates
Calculate rates for stopped ER.- Parameters:
executionRequest- execution requestallTestRuns- all test runs
-
calculateRateFloat
public static float calculateRateFloat(int part, int total) Calculates what percent 'part' is of 'total'. Returns float with 1 number after point.- Parameters:
part- counttotal- count- Returns:
- percent part of total.
-
calculateRateInt
public static int calculateRateInt(int part, int total) Calculates what percent 'part' is of 'total'. Returns int number.- Parameters:
part- counttotal- count- Returns:
- percent part of total.
-
calculateTestRunsTestingStatusStats
public Map<TestingStatuses,RateCalculator.TestingStatusesStat> calculateTestRunsTestingStatusStats(ExecutionRequest executionRequest, List<TestRun> testRuns) Calculate tets runs testing status stats.- Parameters:
testRuns- test runs- Returns:
- result stats
-