Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
theodolite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sören Henning
theodolite
Commits
16bf2a81
Commit
16bf2a81
authored
3 years ago
by
Lorenz Boguhn
Browse files
Options
Downloads
Patches
Plain Diff
Add combine and deduct function to aggregator
parent
9a68b8eb
No related branches found
No related tags found
1 merge request
!208
Add benchmark implementations for Hazelcast Jet
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theodolite-benchmarks/uc4-hazelcastjet/src/main/java/theodolite/uc4/application/uc4specifics/AggregatedActivePowerRecordAccumulator.java
+21
-0
21 additions, 0 deletions
.../uc4specifics/AggregatedActivePowerRecordAccumulator.java
with
21 additions
and
0 deletions
theodolite-benchmarks/uc4-hazelcastjet/src/main/java/theodolite/uc4/application/uc4specifics/AggregatedActivePowerRecordAccumulator.java
+
21
−
0
View file @
16bf2a81
...
...
@@ -53,6 +53,27 @@ public class AggregatedActivePowerRecordAccumulator {
this
.
averageInW
=
sumInW
/
count
;
}
/**
* Adds the records from another aggregator.
*/
public
void
addInputs
(
final
double
sumInW
,
final
long
count
,
final
long
timestamp
)
{
this
.
sumInW
+=
sumInW
;
this
.
count
+=
count
;
this
.
timestamp
=
Math
.
max
(
this
.
timestamp
,
timestamp
);
this
.
averageInW
=
this
.
sumInW
/
this
.
count
;
}
/**
* Removes the values of another aggreagator.
* Not a complete reset since the old timestamp is lost.
*/
public
void
removeInputs
(
final
double
sumInW
,
final
long
count
)
{
this
.
sumInW
-=
sumInW
;
this
.
count
-=
count
;
this
.
averageInW
=
this
.
count
==
0
?
0.0
:
this
.
sumInW
/
this
.
count
;
this
.
timestamp
=
-
1L
;
}
public
long
getCount
()
{
return
count
;
}
...
...
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