wernerfred / check_synology

This plugin will check a lot of different values on your Synology DiskStation.
MIT License
17 stars 25 forks source link

Include cached memory into usable memory calculation #10

Closed KreativeKrise closed 3 years ago

KreativeKrise commented 3 years ago

The memory calculation should also count cached memory into unused memory, because cached memory will be freed when applications require it.

wernerfred commented 3 years ago

Hey, thanks for your contribution. Technically speaking cached memory isn't free (it's cached ;). But I get your point. Thinking about existing (historical) data it might not seem a good idea to change the calculation of free memory. What do you think about calling it usable memory from now on? Like this:

OK - 70.7% usable (232.4 MB free and 1032.0 cached out of 1828.1 MB) |memory_total=1871928c memory_unused=1323004c memory_percent=70% memory_cached=1031928c
KreativeKrise commented 3 years ago

Yes, that makes totally sense. Since I don't use historical data yet, I didn't thought on that use case.

wernerfred commented 3 years ago

Please take a look at my update, check it at your environment and provide feedback. If everything works I will merge the PR

wernerfred commented 3 years ago

Keep in mind that if #9 gets merged you need to update your check command ;)

wernerfred commented 3 years ago

@all-contributors please add @KreativeKrise for code

allcontributors[bot] commented 3 years ago

@wernerfred

I've put up a pull request to add @KreativeKrise! :tada: