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

Monitor GPU poll is bad #329

Open
Delaunay opened this issue Jan 23, 2025 · 2 comments
Open

Monitor GPU poll is bad #329

Delaunay opened this issue Jan 23, 2025 · 2 comments

Comments

@Delaunay
Copy link
Collaborator


class Monitor(Thread):
    """Thread that calls a monitoring function every ``delay`` seconds."""

    def __init__(self, delay, func):
        super().__init__(daemon=True)
        self.stopped = False
        self.delay = delay
        self.func = func
        self.start_time = time.time()
        self.count = 0

    def run(self):
        while not self.stopped:
            time.sleep(0)
            self.func()
            self.count += 1

    def stop(self):
        self.stopped = True
        # (time.time() - self.start_time) / self.count = 2sec  when self.delay == 0.1
@Delaunay
Copy link
Collaborator Author

it is related to the process monitoring that takes up to 3sec

@Delaunay
Copy link
Collaborator Author

Delaunay commented Feb 4, 2025

I moved the process monitoring out of the main monitoring so it won't impact the other metrics

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

No branches or pull requests

1 participant