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

Make contention_metric available for monitoring #2

Merged
merged 2 commits into from Jan 18, 2023

Conversation

milesgranger
Copy link
Owner

@milesgranger milesgranger commented Jan 17, 2023

Makes contention_metric a continuously updated value,
so long as the monitoring thread is running.

Example from one of the updated tests:

        # usually ~0.9 on linux ~0.6 on windows
        assert knocker.contention_metric > 0.6

        # Now wait for it to 'cool' back down
        # by looping over some work which releases the GIL
        prev_cm = knocker.contention_metric
        for i in range(10):
            a_little_gil()
            assert knocker.contention_metric < prev_cm
            prev_cm = knocker.contention_metric

        # ~0.15 oN mY MaChInE.
        assert knocker.contention_metric < 0.2

Ref: dask/distributed#7290 (comment)

@milesgranger milesgranger merged commit 8e107d3 into main Jan 18, 2023
@milesgranger milesgranger deleted the make-monitorable branch January 18, 2023 05:35
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.

None yet

1 participant