Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aggregator: remove synchronous RPCs and extend to generic values #1535

Merged
merged 4 commits into from May 29, 2018

Conversation

grondo
Copy link
Contributor

@grondo grondo commented May 24, 2018

This is overall a fairly minor improvement to the aggregator module.

First the remaining synchronous RPCs were removed. Then the int64_t "value" (the target of the aggregate) was replaced with a generic json_t value. This allows identical values to be aggregated other than just integers, including floating-point, strings, and even JSON objects. As long as json_equal() returns true between two values, they will be coalesced by integer identifier.

The "summary statistics" (min, max) are generalized into a summary object, however this is (currently) only supported for real and integer values.

@codecov-io
Copy link

codecov-io commented May 24, 2018

Codecov Report

Merging #1535 into master will increase coverage by <.01%.
The diff coverage is 83%.

@@            Coverage Diff             @@
##           master    #1535      +/-   ##
==========================================
+ Coverage    78.8%   78.81%   +<.01%     
==========================================
  Files         164      164              
  Lines       30333    30378      +45     
==========================================
+ Hits        23905    23941      +36     
- Misses       6428     6437       +9
Impacted Files Coverage Δ
src/modules/aggregator/aggregator.c 79.86% <83%> (-0.38%) ⬇️
src/common/libkvs/kvs_watch.c 89.69% <0%> (-0.43%) ⬇️
src/common/libflux/message.c 81.17% <0%> (-0.12%) ⬇️
src/broker/overlay.c 74.13% <0%> (ø) ⬆️
src/common/libflux/mrpc.c 86.66% <0%> (+1.17%) ⬆️

@grondo grondo force-pushed the aggregator-generalize branch 2 times, most recently from 431549f to 51c8f3d Compare May 24, 2018 22:18
@grondo
Copy link
Contributor Author

grondo commented May 24, 2018

I made some changes, squashed and forced a push.

The testing now tests floating point, string, array, and object value types. The flux-aggregate test utility was extended to allow this by accepting values on the cmd line of arbitrary types.

@coveralls
Copy link

coveralls commented May 25, 2018

Coverage Status

Coverage increased (+0.02%) to 79.139% when pulling a3563f9 on grondo:aggregator-generalize into 8bbdc3b on flux-framework:master.

@garlick
Copy link
Member

garlick commented May 28, 2018

This seems like a useful enhancement!

Should we open a separate issue on creating a C API and man pages for the aggregator?

This can go in as far as I'm concerned, just needs a rebase.

Update the aggregator to remove use of synchronous RPCs in
the forward and sink methods.
Extend the aggregator such that any json_t value can be aggregated.

Values will be aggregated for any json_t types where `json_equal`
returns true. The aggregator will thus now work for integer and double
types, as well as strings, arrays, and even objects.

Summary statistics (max,min) are only supported for integer and
real types. The max and min members are kept at the top level of the
json result written to kvs by the "sink" implementation.
Loosen restrictions on the types of values aggregated by the
flux-aggregate test utility.

Allow value argument on flux-aggregate cmdline to be a string or a
numeric value.

Add a `-e, --execute=CODE` argument to allow values that are created
from arbitrary Lua CODE. This allows generation of arrays and complex
objects for aggregator testing.
Add tests to ensure floating point, string, and complex object types
work as the value target of aggregates.
@garlick
Copy link
Member

garlick commented May 29, 2018

Restarted a bunch of stalled builders - looks like a travis issue, not one of ours.

@garlick garlick merged commit 531a47a into flux-framework:master May 29, 2018
@grondo grondo deleted the aggregator-generalize branch July 27, 2018 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants