-
Notifications
You must be signed in to change notification settings - Fork 5
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
NMS-13176: add testing module including a benchmark app #28
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor nits and some proposals for the cardinality of some dimensions of the generated flows. I'm not sure if this is relevant for the current test but seems nice to have these available.
testing/src/main/java/org/opennms/nephron/testing/benchmark/Benchmark.java
Outdated
Show resolved
Hide resolved
testing/src/main/java/org/opennms/nephron/testing/flowgen/FlowDocuments.java
Outdated
Show resolved
Hide resolved
testing/src/main/java/org/opennms/nephron/testing/flowgen/FlowDocuments.java
Outdated
Show resolved
Hide resolved
testing/src/main/java/org/opennms/nephron/testing/flowgen/FlowDocuments.java
Outdated
Show resolved
Hide resolved
testing/src/main/java/org/opennms/nephron/testing/flowgen/FlowDocuments.java
Outdated
Show resolved
Hide resolved
/** | ||
* Determines if a flow is emitted or not. | ||
*/ | ||
public abstract class Limiter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use resilience4j RateLimiter
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep the current implementation. Its minimal and does exactly what is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would turn this around: Is there any reason not to use an implementation somebody else takes care for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resilience4j.RateLimiter seems to be an overkill here. RateLimiterConfig
, RateLimiterRegistry
, and RateLimiter
are lots of ceremony. More severly: Looking through the documentation I did not see if there is a check(numberOfPermits) method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is reservePermission(numberOfPermits)
. If it returns 0 the call is permitted.
The registry is completely optional and the config is a temporary object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spent some time on resilience4j.RateLimiter
and still think it is way too complicated. There seems to be no simple possibility to disable it. In addition, our limiter has not to be thread-safe. The custom Limiter implementation is simple. There is no maintenance burden. I see no benefit to use a dependency as a replacement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
¯\(ツ)/¯
testing/src/main/java/org/opennms/nephron/testing/flowgen/SourceConfig.java
Outdated
Show resolved
Hide resolved
testing/src/main/java/org/opennms/nephron/testing/flowgen/SyntheticFlowSource.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Dustin Frisch <fooker@lab.sh>
…nchmark.java Co-authored-by: Dustin Frisch <fooker@lab.sh>
…heticFlowSource.java Co-authored-by: Dustin Frisch <fooker@lab.sh>
Issue: https://issues.opennms.org/browse/NMS-13176
testing
module that contains functionality to generate synthetic flows, write those flows to Kafka, or use them directly in a pipeline. In addition, a benchmark app can measure the throughput and processing time of pipeline runs.TimestampPolicyFactory
must now be supplied when constructing aReadFromKafka
instance. This was necessary because the benchmark app needs a slightly patched timestamp policy factory.