-
Notifications
You must be signed in to change notification settings - Fork 379
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
feat: allow specifying timeout for cluster metrics aggregation #645
base: master
Are you sure you want to change the base?
Conversation
@@ -36,10 +36,11 @@ class AggregatorRegistry extends Registry { | |||
/** | |||
* Gets aggregated metrics for all workers. The optional callback and | |||
* returned Promise resolve with the same value; either may be used. | |||
* @param {ClusterMetricsOptions|undefined} options Additional options for cluster metrics aggregation. |
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.
* @param {ClusterMetricsOptions|undefined} options Additional options for cluster metrics aggregation. | |
* @param {ClusterMetricsOptions|undefined} options Additional options for cluster metrics aggregation. | |
* @param {number} [options.timeoutMs=5000] Timeout to wait for all workers to respond before error. |
You can document the timeoutMs field as well
@@ -136,10 +136,11 @@ export class AggregatorRegistry< | |||
> extends Registry<T> { | |||
/** | |||
* Gets aggregated metrics for all workers. | |||
* @param {ClusterMetricsOptions|undefined} options Additional options for cluster metrics aggregation |
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.
* @param {ClusterMetricsOptions|undefined} options Additional options for cluster metrics aggregation | |
* @param {ClusterMetricsOptions|undefined} options Additional options for cluster metrics aggregation | |
* @param {number} [options.timeoutMs=5000] Timeout to wait for all workers to respond before error. |
@@ -192,6 +193,10 @@ export enum MetricType { | |||
Summary, | |||
} | |||
|
|||
export type ClusterMetricsOptions = { | |||
timeoutMs?: number; |
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.
timeoutMs?: number; | |
/** Timeout to wait for all workers to respond before error. */ | |
timeoutMs?: number; |
This can be documented as well
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.
Adds ability to specify cluster metrics aggregation timeout.
Overriding hard-coded timeout as a workaround for #628 where scraping in larger projects end up in a timeout most of the time.