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

fix worker state default metric value #4895

Merged
merged 1 commit into from
Dec 13, 2019

Conversation

kirillbilchenko
Copy link
Contributor

@kirillbilchenko kirillbilchenko commented Dec 13, 2019

Signed-off-by: kyrylo.bilchenko kirya7@gmail.com

Existing Issue

Fixes # .
Fixes #3856

Contributor Checklist

Are the following items included as part of this PR? Please delete checkbox items that don't apply.

Reviewer Checklist

This section is intended for the core maintainers only, to track review progress. Please do not
fill out this section.

  • Code reviewed
  • Tests reviewed
  • Documentation reviewed
  • Release notes reviewed
  • PR acceptance performed
  • New config flags added? Ensure that they are added to the BOSH
    and Helm packaging; otherwise, ignored for the integration tests (for example, if they are Garden configs that are not displayed in the --help text).

Signed-off-by: kyrylo.bilchenko <kirya7@gmail.om>
@kirillbilchenko kirillbilchenko requested a review from a team December 13, 2019 11:47
Copy link
Contributor

@xtremerui xtremerui left a comment

Choose a reason for hiding this comment

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

Thank you for the fix!

@xtremerui xtremerui merged commit 27232ea into concourse:master Dec 13, 2019
@zoetian zoetian added this to the v5.8.0 milestone Dec 16, 2019
@zoetian zoetian added the release/documented Documentation and release notes have been updated. label Dec 16, 2019
jamieklassen pushed a commit that referenced this pull request Jan 11, 2020
This commit also backfills tests for ths WorkersState metric. It turns out that
there was enough untested logic there that a bug was introduced when
#4895 was implemented, so it's high time to have some tests!

It was more difficult than I expected to get the metric into a test harness --
the code had a problem with what Michael Feathers calls "sensing". It's not
expensive to instantiate the metric, but it is difficult to observe the effect
of its `Emit` method being called, since the `emitLoop` function in the `metric`
package asynchronously passes events to the emitter in a goroutine.

I think we should be able to isolate the metric from that emission channel in
tests.

#4985
#3856

Signed-off-by: Jamie Klassen <cklassen@pivotal.io>
jamieklassen pushed a commit that referenced this pull request Jan 11, 2020
This commit also backfills tests for ths WorkersState metric. It turns out that
there was enough untested logic there that a bug was introduced when
#4895 was implemented, so it's high time to have some tests!

It was more difficult than I expected to get the metric into a test harness --
the code had a problem with what Michael Feathers calls "sensing". It's not
expensive to instantiate the metric, but it is difficult to observe the effect
of its `Emit` method being called, since the `emitLoop` function in the `metric`
package asynchronously passes events to the emitter in a goroutine.

Accordingly I tried to put pretty aggressive names on the helper functions. I
think we should be able to isolate the metric from the `emissions` channel in
tests, but I think it would be better to do it uniformly across all the various
metrics. I haven't really thought it through yet at this point.

#4985
#3856

Signed-off-by: Jamie Klassen <cklassen@pivotal.io>
jamieklassen pushed a commit that referenced this pull request Jan 11, 2020
This commit also backfills tests for ths WorkersState metric. It turns out that
there was enough untested logic there that a bug was introduced when
#4895 was implemented, so it's high time to have some tests!

It was more difficult than I expected to get the metric into a test harness --
the code had a problem with what Michael Feathers calls "sensing". It's not
expensive to instantiate the metric, but it is difficult to observe the effect
of its `Emit` method being called, since the `emitLoop` function in the `metric`
package asynchronously passes events to the emitter in a goroutine.

I also think its possible that running these tests in multiple threads could
case data races -- accordingly I tried to put pretty aggressive names on the
helper functions. I think we should be able to isolate the metric from the
`emissions` channel in tests, but I think it would be best to do the same thing
uniformly across all the various metrics. I haven't really thought it through
yet at this point.

#4985
#3856

Signed-off-by: Jamie Klassen <cklassen@pivotal.io>
jamieklassen pushed a commit that referenced this pull request Jan 11, 2020
This commit also backfills tests for ths WorkersState metric. It turns out that
there was enough untested logic there that a bug was introduced when
#4895 was implemented, so it's high time to have some tests!

It was more difficult than I expected to get the metric into a test harness --
the code had a problem with what Michael Feathers calls "sensing". It's not
expensive to instantiate the metric, but it is difficult to observe the effect
of its `Emit` method being called, since the `emitLoop` function in the `metric`
package asynchronously passes events to the emitter in a goroutine.

I also think its possible that running these tests in multiple threads could
cause data races -- accordingly I tried to put pretty aggressive names on the
helper functions. I think we should be able to isolate the metric from the
`emissions` channel in tests, but I think it would be best to do the same thing
uniformly across all the various metrics. I haven't really thought it through
yet at this point.

#4985
#3856

Signed-off-by: Jamie Klassen <cklassen@pivotal.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release/documented Documentation and release notes have been updated.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Two bugs in the concourse_workers_registered Prometheus metric
3 participants