Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Verification for Decision Model and Notation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Container registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Blatt
Verification for Decision Model and Notation
Commits
d42df683
Commit
d42df683
authored
5 years ago
by
Jonas Blatt
Browse files
Options
Downloads
Patches
Plain Diff
Add implementation of verification metrics for execution time
parent
fa3aeaf7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dmnverifierapi/src/main/java/de/unikoblenz/fgbks/core/dmn/verification/metrics/MetricSet.java
+40
-0
40 additions, 0 deletions
...oblenz/fgbks/core/dmn/verification/metrics/MetricSet.java
with
40 additions
and
0 deletions
dmnverifierapi/src/main/java/de/unikoblenz/fgbks/core/dmn/verification/metrics/MetricSet.java
0 → 100644
+
40
−
0
View file @
d42df683
package
de.unikoblenz.fgbks.core.dmn.verification.metrics
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
de.unikoblenz.fgbks.core.dmn.verification.verifier.types.VerificationType
;
import
java.io.Serializable
;
import
java.util.HashSet
;
import
java.util.Set
;
import
org.apache.commons.lang3.Validate
;
/**
* A metric set contains all metrics.
*/
public
class
MetricSet
implements
Serializable
{
private
Set
<
Metric
>
metrics
=
new
HashSet
<>();
/**
* Get all metrics.
*
* @return the set of {@link Metric}s
*/
@JsonProperty
(
"verificationMetrics"
)
public
Set
<
Metric
>
getMetrics
()
{
return
new
HashSet
<>(
metrics
);
}
/**
* Add a new execution time of a verifier to the metric map
*
* @param type the {@link VerificationType}
* @param timeInNs the time in ns
*/
public
synchronized
void
addExecutionTime
(
VerificationType
type
,
long
timeInNs
)
{
Validate
.
notNull
(
type
);
Metric
m
=
metrics
.
stream
().
filter
(
x
->
x
.
type
.
equals
(
type
)).
findFirst
().
orElse
(
new
Metric
(
type
));
m
.
addExecutionTime
(
timeInNs
);
metrics
.
add
(
m
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment