Skip to content

Commit

Permalink
better variable naming inside PQPS
Browse files Browse the repository at this point in the history
  • Loading branch information
nck-mlcnv committed Oct 24, 2023
1 parent 56f60bd commit 24dff01
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/aksw/iguana/cc/metrics/impl/PQPS.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ public PQPS(@JsonProperty("penalty") Integer penalty) {

@Override
public Number calculateQueryMetric(List<HttpWorker.ExecutionStats> data) {
BigDecimal successes = BigDecimal.ZERO;
BigDecimal numberOfExecutions = BigDecimal.ZERO;
Duration totalTime = Duration.ZERO;
for (HttpWorker.ExecutionStats exec : data) {
successes = successes.add(BigDecimal.ONE);
numberOfExecutions = numberOfExecutions.add(BigDecimal.ONE);
if (exec.successful()) {
totalTime = totalTime.plus(exec.duration());
} else {
Expand All @@ -35,7 +35,7 @@ public Number calculateQueryMetric(List<HttpWorker.ExecutionStats> data) {
BigDecimal tt = (new BigDecimal(BigInteger.valueOf(totalTime.toNanos()), 9));

try {
return successes.divide(tt, 10, RoundingMode.HALF_UP);
return numberOfExecutions.divide(tt, 10, RoundingMode.HALF_UP);
} catch (ArithmeticException e) {
return BigDecimal.ZERO;
}
Expand Down

0 comments on commit 24dff01

Please sign in to comment.