How do you tell which pool stat belongs to which pool?
The name of a pool stat looks like this: subnet[1].pool[0].assigned-nas
.
There is no easy traceability between a pool and its ID in the stats. Pools have their IDs sorted by first address. So when a user wants to know the stats for a pool, they would have to sort them by first address, and then count to see on what position (i.e. ID) the pool is. That's not very user-friendly.
You may argue that the same problem exists with subnets, but:
- Subnet IDs are sometimes specified in the config next to the subnet. Regardless, subnet IDs always appear in config-get results so they can be easily fetched and matched that way.
- If not explicitly specified, subnet IDs are sorted by the order that subnets are declared in the config, so even that is easier to figure out than for pool IDs.
- Subnet IDs are mentioned in logs in abundance, so admins who watch logs may become familiar with them. Pool IDs are not mentioned at all in logs.
One idea is to pass a tuple to StatsMgr
when adding values or setting values. The tuple would contain, in addition to the usual integer value, a string with the text description of the pool which can be acquired from Pool::toText()
. The tuple would translate into a list in the JSON response:
"subnet[1].pool[0].assigned-nas": [
[
[2, "2001:db8::/64"],
"1970-01-01 00:00:00.000000"
]
]
As opposed to how it is now, which is:
"subnet[1].pool[0].assigned-nas": [
[
2,
"1970-01-01 00:00:00.000000"
]
]