Adds support for memory usage in percent

This commit is contained in:
Franck Nijhof 2019-08-18 14:50:06 +02:00
parent d5848fc7e0
commit 75590a9ac1
No known key found for this signature in database
GPG key ID: D62583BA8AB11CA3
3 changed files with 39 additions and 2 deletions

View file

@ -1022,6 +1022,21 @@ function bashio::addon.memory_limit() {
'.memory_limit'
}
# ------------------------------------------------------------------------------
# Returns memory usage in percentage for the specified add-on.
#
# Arguments:
# $1 Add-on slug (optional, default: self)
# ------------------------------------------------------------------------------
function bashio::addon.memory_percent() {
local slug=${1:-'self'}
bashio::log.trace "${FUNCNAME[0]}" "$@"
bashio::addons.stats \
"${slug}" \
"addons.${slug}.stats.memory_percent" \
'.memory_percent'
}
# ------------------------------------------------------------------------------
# Returns outgoing network usage from the specified add-on.
#