Skip to content

Rewrite getMemory / getCPUName / getUptime - #183

Merged
rullzer merged 8 commits into
masterfrom
enh/noid/proc-getmemory
Apr 14, 2020
Merged

Rewrite getMemory / getCPUName / getUptime#183
rullzer merged 8 commits into
masterfrom
enh/noid/proc-getmemory

Conversation

@kesselb

@kesselbkesselb commented Mar 15, 2020

Copy link
Copy Markdown
Collaborator
  • Fix wrong namespace
  • Use file_get_contents instead of shell_exec for uptime, hostname, cpu name, memory info
  • FormatBytes expected kB instead of byte.
  • Make parsing testable

@kesselbkesselb added this to the Nextcloud 19 milestone Mar 15, 2020
@kesselb
kesselbforce-pushed the enh/noid/proc-getmemory branch 2 times, most recently from 219b417 to 07880ccCompareMarch 15, 2020 20:28
@kesselbkesselb mentioned this pull request Mar 16, 2020
@kesselbkesselb changed the title Rewrite getMemoryRewrite getMemory / getCPUName / getUptimeMar 16, 2020
I don't know why php does not complain but phpunit were not able to locate the files.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Don't use shell_exec to fetch that information anymore, Make it testable
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@kesselb
kesselbforce-pushed the enh/noid/proc-getmemory branch from 1eb6a9b to 89091eeCompareMarch 17, 2020 19:29
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
I guess the confusion was the df -TP already returns the values as kB instead of bytes hence we have to multiply the values first before we pass them to FormatBytes.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@kesselb
kesselbforce-pushed the enh/noid/proc-getmemory branch from 89091ee to 4a816d1CompareMarch 17, 2020 19:33
@rullzerrullzer mentioned this pull request Apr 4, 2020
80 tasks
@kesselb
kesselb marked this pull request as ready for review April 4, 2020 19:59
# Conflicts:
#	lib/OperatingSystems/DefaultOs.php
#	templates/settings-admin.php
@rullzerrullzer mentioned this pull request Apr 9, 2020
59 tasks
@rullzer
rullzer merged commit 310f821 into masterApr 14, 2020
@delete-merged-branch
delete-merged-branchBot deleted the enh/noid/proc-getmemory branch April 14, 2020 19:02
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@kesselb@rullzer