-
Notifications
You must be signed in to change notification settings - Fork 13
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
Refactor PromMetrics to use Collect functions #3607
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.
I think this looks good
@@ -326,6 +314,7 @@ export class WorkerExecutionContext | |||
} | |||
|
|||
async onSliceFinished(): Promise<void> { | |||
this.slicesFinished++; |
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 guess this will max out at 9quadrillion. We have jobs completing 2 million slices a day. I guess a job would have to run 4.5 billion days to hit that. Should be fine.
> Number.MAX_SAFE_INTEGER/2_000_000
4503599627.370496
logger: Logger, | ||
) { | ||
this.context = context; | ||
this.name = name; |
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 am happy to see the removal of a context
object passed in ...
name: string, | ||
help: string, | ||
labelsNames: Array<string>, | ||
type: 'gauge' | 'counter' | 'histogram', | ||
buckets: Array<number> = [0.1, 5, 15, 50, 100, 500] |
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.
In hindsight, the presence of this optional buckets argument should have been a clue that addMetric
was too ambitious.
I would like to merge this but I would like @jsnoble to double check some of the lower level type changes. I think he's seen these recently but I didn't want to merge without an OK from him. |
bump: (minor) @terascope/job-components@0.74.0, terafoundation@0.63.0 bump: (minor) @terascope/types@0.17.0, @terascope/utils@0.59.0 bump: (minor) @terascope/data-types@0.50.0, @terascope/data-mate@0.56.0 bump: (minor) elasticsearch-store@0.84.0, ts-transforms@0.85.0 bump: (minor) xlucene-parser@0.58.0, xlucene-translator@0.44.0 bump: (minor) @terascope/elasticsearch-api@3.20.0, @terascope/teraslice-state-storage@0.53.0
563ff48
to
4871320
Compare
This PR makes the following changes:
addMetric
into individual functions for counter, gauge, and histogram.collect()
parameter to alladd<metric>
functions.prom-client
types intotypes
packageterafoundation
andjob-components
and import fromtypes
. This required some refactoring to not use context as a parameter, as thecontext
type differs betweenterafoundation
andjob-components
.info
metrics of slice, worker, and master into thesetPromMetrics()
functions.