Skip to content
This repository was archived by the owner on Nov 17, 2020. It is now read-only.

Add endpoints for memory: absolute and relative #181

Merged
merged 4 commits into from
Apr 18, 2016

Conversation

dcorbacho
Copy link
Contributor

Add endpoints for memory: absolute and relative
Solves #161

@michaelklishin This PR is missing the tests for relative memory, as I need confirmation of:

  1. Is it fine to report relative memory as an integer value?
  2. If memory usage is very low, but not 0, should it be reported as 0 or 1? Meaning that the component is indeed doing something.

@michaelklishin
Copy link
Contributor

@dcorbacho I'd say integer values (as %) is good enough. Reporting a value as 0 would indeed be weird, so I'm OK with using 1% for those cases.

@michaelklishin michaelklishin self-assigned this Apr 17, 2016
@michaelklishin michaelklishin added this to the n/a milestone Apr 17, 2016
@michaelklishin
Copy link
Contributor

The relative endpoint returns a total value that seems absolute. If other numbers are meant to add up to 100, I'd say we should return 100 for total:

{
    "memory": {
        "atom": 1,
        "binary": 1,
        "code": 24,
        "connection_channels": 0,
        "connection_other": 1,
        "connection_readers": 0,
        "connection_writers": 0,
        "mgmt_db": 1,
        "mnesia": 1,
        "msg_index": 1,
        "other_ets": 2,
        "other_proc": 16,
        "other_system": 54,
        "plugins": 3,
        "queue_procs": 1,
        "queue_slave_procs": 0,
        "total": 100594608
    }
}

@dcorbacho WDYT?

@dcorbacho
Copy link
Contributor Author

I think that you are right. I'll fix it now

@michaelklishin michaelklishin merged commit 1863809 into stable Apr 18, 2016
@gerhard
Copy link
Contributor

gerhard commented Jun 14, 2017

We've just come across this part of rabbitmq/rabbitmq-server#1259 and noticed 2 things:

  1. Relative memory usage adds up to 106% in a just started RabbitMQ node and 115% in one of the 3.6 LRE nodes. Would it be worth returning fractions with single precision rather than rounded integers? Single precision rounding will skew the total by at most 1.7% (17 values * 0.1)
  2. The /api/nodes/NODE/memory API endpoint is not documented in /api. Should it be?

@michaelklishin
Copy link
Contributor

@gerhard we can switch to floats with, say, 2 decimal places. @dcorbacho @kjnilsson WDYT?

@gerhard
Copy link
Contributor

gerhard commented Jun 14, 2017

That would be perfect. Can this ship in 3.6 or is it a breaking change?

@kjnilsson
Copy link
Contributor

kjnilsson commented Jun 14, 2017

2 decimal places sounds reasonable.

@michaelklishin
Copy link
Contributor

@gerhard most JSON parsers should parse integers much like floats. Computations on floats can work differently depending on the language. I think it's acceptable given other changes around VM memory consumption calculations.

@dumbbell dumbbell deleted the rabbitmq-management-161 branch January 3, 2018 08:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants