-
Notifications
You must be signed in to change notification settings - Fork 984
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
Publish relative to PushMeterRegistry initialization time and align StepMeter boundaries to that #3450
Publish relative to PushMeterRegistry initialization time and align StepMeter boundaries to that #3450
Changes from all commits
82dca79
85dcfe0
4ae4969
3fbd2c3
fc258da
49bbb41
0027687
fb734a2
cc0df1e
0bceaba
b1470a8
9835785
147f183
3752129
530b665
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,6 +90,22 @@ default int batchSize() { | |
return getInteger(this, "batchSize").orElse(10000); | ||
} | ||
|
||
/** | ||
* This controls when the call to {@link PushMeterRegistry#publish()} is scheduled. If | ||
* this returns true, publishing is scheduled at the same time relative to the Unix | ||
* Epoch regardless of when the registry was created. This has the effect of causing | ||
* all application instances publishing metrics with the same configuration to publish | ||
* at the same point in time globally, which may overload resources by concentrating | ||
* the work to publish and ingest metrics from many application instances. The more | ||
* instances you have publishing metrics at the same time, the more of a problem this | ||
* will be. | ||
* @return false if publishing should be scheduled relative to registry instantiation | ||
* time. Default is {@code false} to avoid the documented resource exhaustion issue. | ||
*/ | ||
default boolean isPushAlignedGlobally() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could probably spend endless time coming up with better and better names, but here's a third iteration where I've avoided using "epoch" in the name because I think it will be less clear what this does compared to focusing on the effect of pushes being aligned globally if you set this to I've updated the JavaDoc to explain the issue that motivated this configuration being introduced and the reason for its default. |
||
return getBoolean(this, "isPushAlignedGlobally").orElse(false); | ||
} | ||
|
||
@Override | ||
default Validated<?> validate() { | ||
return validate(this); | ||
|
@@ -105,7 +121,8 @@ static Validated<?> validate(PushRegistryConfig config) { | |
return checkAll(config, check("step", PushRegistryConfig::step), | ||
check("connectTimeout", PushRegistryConfig::connectTimeout), | ||
check("readTimeout", PushRegistryConfig::readTimeout), | ||
check("batchSize", PushRegistryConfig::batchSize), check("numThreads", PushRegistryConfig::numThreads)); | ||
check("batchSize", PushRegistryConfig::batchSize), check("numThreads", PushRegistryConfig::numThreads), | ||
check("isPushAlignedGlobally", PushRegistryConfig::isPushAlignedGlobally)); | ||
} | ||
|
||
} |
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 changed the name of this method and added a JavaDoc in hopes of making things more clear.