Skip to content
Snippets Groups Projects
Commit 2f640f14 authored by Jonas Blatt's avatar Jonas Blatt :ant:
Browse files

Add first idea for a metric implementation for dmn verifications

parent 54dfc924
No related branches found
No related tags found
No related merge requests found
package de.unikoblenz.fgbks.core.dmn.verification;
import de.unikoblenz.fgbks.core.dmn.verification.metrics.Metric;
import de.unikoblenz.fgbks.core.dmn.verification.verifier.types.VerificationType;
import java.util.HashMap;
import javax.enterprise.context.ApplicationScoped;
@ApplicationScoped
public class DmnVerificationMetricsService {
private HashMap<VerificationType, Metric> metrics;
}
package de.unikoblenz.fgbks.core.dmn.verification.metrics;
import de.unikoblenz.fgbks.core.dmn.verification.verifier.types.VerificationType;
import java.util.ArrayList;
import java.util.List;
public class Metric {
VerificationType type;
private List<Integer> executionTimes;
public Metric() {
this.executionTimes = new ArrayList<>();
}
public int getAmountOfExecutions() {
return executionTimes.size();
}
public double getAverageExecutionTime() {
return executionTimes.stream().mapToInt(Integer::intValue).average().orElseGet(() -> 0);
}
public int getTotalExecutionTime() {
return executionTimes.stream().mapToInt(Integer::intValue).sum();
}
@Override
public String toString() {
return super.toString();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment