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: Add Cpu Usage % to header for standalone server #3840

Closed
wants to merge 4 commits into from

Conversation

IgorA100
Copy link
Contributor

After:
After

@IgorA100 IgorA100 marked this pull request as draft February 24, 2024 16:32
@IgorA100 IgorA100 marked this pull request as ready for review February 24, 2024 16:35
@connortechnology
Copy link
Member

The reason I didn't implement this, although it is nice to have as part of the toolset, is that I WILL NOT add a 1 second pause to loading the UI, so the plan was to make sure the db Server object existed and got updated even for non-multi-server case.

Also, beware, not all OS's have /proc. In fact, linux may not have /proc either.

@IgorA100
Copy link
Contributor Author

IgorA100 commented Feb 25, 2024

I WILL NOT add a 1 second pause to loading the UI,

I've updated the code.
The 1 second pause is no longer used.

Also, beware, not all OS's have /proc. In fact, linux may not have /proc either.

For Windows, you can receive the download without any gaps. I can add some code. But can Zoneminder be installed on Windows?
What systems can ZM be installed on?

linux may not have /proc either.

I’m not ready to answer anything yet, I need to think.
Which Linux systems don't have /proc

so the plan was to make sure the db Server object existed and got updated even for non-multi-server case

I see that CpuUsagePercent is not updated for server, although CpuLoad is updated.
I don't know why this happens, because... I haven't studied code in detail. Probably this is executed somewhere in Perl scripts?
As far as I understand, ID is not assigned to a single server?

@connortechnology
Copy link
Member

OpenBSD is the prime example of not having /proc. In linux land a container or something might not have it. It is uncommon, but possible. Which is why I left the top parsing code in perl-side.

The top parsing is not reliable though. I intend to change the parsing to perl regexps instead of bash awk, etc to see what the actual output is that fails.

In terms of SERVER_ID, we can just use = 0 when not in multi-server mode. Code just needs a few tweaks to make that work.

This is all work in progress. Might be better if you joined slack, or discord or something to discuss with me more to prevent overlap of effort. Or maybe even the discussion parts of github since you are already here. Or forums...

@IgorA100
Copy link
Contributor Author

Ok Isaac, I get it.
I'm more used to communicating on the forum.
You've done a lot of work on detecting memory leaks. I haven't found any obvious problems with memory usage in the latest versions!

@IgorA100 IgorA100 marked this pull request as draft February 25, 2024 15:09
@connortechnology
Copy link
Member

I'll try communicate better. Too used to working alone around here. I'll likely merge this, but just be aware that my plan is for most of this nice work to be not needed as the values will be updated in background in the db.

@IgorA100
Copy link
Contributor Author

I understand your thoughts.
Yes, my solution is temporary.
Maybe I'll look at the Pearl scripts a little later.
You already have more important tasks.

@davidcomerford
Copy link

I'm confused why we'd want CPU usage if we already have system load average?

@IgorA100
Copy link
Contributor Author

These are slightly different values.

@connortechnology
Copy link
Member

They are very different values. On many of my servers, the load can be 20 or more, but cpu usage is about 50%. There are lots of different reasons why processes might be waiting on service (which is what load is a measure of).

@IgorA100
Copy link
Contributor Author

Closed as a draft because... there is a more recent version #3843

@IgorA100 IgorA100 closed this Apr 27, 2024
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.

3 participants