Skip to content

Buggy value for memory_internal_free on Dom0 #6157

Closed
@TSnake41

Description

@TSnake41

memory_internal_free is actually reported as bytes but with kilobytes instead.

https://github.com/xapi-project/xen-api/blob/26b6ed61d4edef2699b34eacfb0c901b9edb1b45/ocaml/xcp-rrdd/bin/rrdd/xcp_rrdd.ml

let mem_available () =
  let* size, kb = scan "/proc/meminfo" in
  match kb with "kB" -> ok size | _ -> res_error "unexpected unit: %s" kb

This is read as kilobytes (and is it actually reading the MemAvailable ?)

match mem_available () with
 | Ok mem ->
    Some
     ( Rrd.VM uuid
     , Ds.ds_make ~name:"memory_internal_free" ~units:"B"
    ~description:"Dom0 current free memory"
    ~value:(Rrd.VT_Int64 mem) ~ty:Rrd.Gauge ~min:0.0
    ~default:true ()
    )

But this is pushed as is, with units as "B" instead of "KiB".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions