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

Add metrics #655

Closed
wants to merge 9 commits into from
Closed

Add metrics #655

wants to merge 9 commits into from

Conversation

gorodet-sky
Copy link
Contributor

@gorodet-sky gorodet-sky commented Jan 10, 2024

What does this do?

Add interface for collect jobs execution metrics: counter, time elapsed

Which issue(s) does this PR fix/relate to?

Resolves #317

List any changes that modify/break current functionality

Have you included tests for your changes?

Yes, tests for counter was added

Did you document any new/modified functionality?

  • Updated example_test.go
  • Updated README.md

Notes

  • It seems to me that you can add a test for elapsed time, but I don’t know how to do it nice
  • In the future I want to make a metrics implementation for Prometheus in a separate repository

metrics.go Outdated Show resolved Hide resolved
executor.go Outdated Show resolved Hide resolved
example_test.go Outdated Show resolved Hide resolved
executor.go Outdated
@@ -23,6 +23,7 @@ type executor struct {
limitMode *limitModeConfig
elector Elector
locker Locker
monitorer Monitorer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
monitorer Monitorer
monitor Monitor

metrics.go Outdated
Comment on lines 19 to 20
// Monitorer represents the interface to collect jobs metrics.
type Monitorer interface {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this just Monitor throughout?

Suggested change
// Monitorer represents the interface to collect jobs metrics.
type Monitorer interface {
// Monitor represents the interface to collect jobs metrics.
type Monitor interface {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, done

@gorodet-sky gorodet-sky changed the title Add metrics each run of job Add metrics Jan 11, 2024
@gorodet-sky gorodet-sky deleted the job-exec-metrics branch January 11, 2024 10:04
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.

[FEATURE] - Add Metrics For Jobs
2 participants