Runner's /varz endpoint - how "available_disk_ratio" is computed?


Rafal Radecki
 

Hi :)

I tried to find in the source code on one of my runners how available_disk_ratio is computed. Initially I thought that it will show how much space there is available on my runner, for example:

df -h /var/vcap/data/
Filesystem Size Used Avail Use% Mounted on
/dev/xvdb2 820G 12G 767G 2% /var/vcap/data

So on my runner I see that 98% of space is free but in /varz I see that

available_disk_ratio -> 0.97152

From cf documentation (http://docs.pivotal.io/pivotalcf/customizing/use-metrics.html):
"available_disk_ratio Percentage of disk available for allocation by future applications/staging requests"
I tried to check this in source code ->
/var/vcap/data/packages/dea_next/b4fe12b3a1243a6724e8b80c39f5ee62c47b3168.1-e0eb07312ea47e31e414c7fb70474ff7d99a6cd2/lib/dea/bootstrap.rb
/var/vcap/data/packages/dea_next/b4fe12b3a1243a6724e8b80c39f5ee62c47b3168.1-e0eb07312ea47e31e414c7fb70474ff7d99a6cd2/lib/dea/resource_manager.rb
but I got to the point of
module Dea
class ResourceManager
DEFAULT_CONFIG = {
"memory_mb" => 8 * 1024,
"memory_overcommit_factor" => 1,
"disk_mb" => 16 * 1024 * 1024,
"disk_overcommit_factor" => 1,
}.freeze
in resource_manager.rb.
Can anyone tell me how available_disk_ratio is exactly computed? I am not sure but base on the lines for DEFAULT_CONFIG I think that it may be computed based on statically set "disk_mb" value ;)
Overall I need this to my monitoring. Are there maybe other ways to tell how many disc space is available on a given runner?

BR,
Rafal.

Join {cf-dev@lists.cloudfoundry.org to automatically receive all group messages.