f72e599ee7
This change makes few compromises: * Looks up the devices associated with tasks at look up time. Given that `nomad alloc status` is called rarely generally (compared to stats telemetry and general job reporting), it seems fine. However, the lookup overhead grows bounded by number of `tasks x total-host-devices`, which can be significant. * `client.Client` performs the task devices->statistics lookup. It passes self to alloc/task runners so they can look up the device statistics allocated to them. * Currently alloc/task runners are responsible for constructing the entire RPC response for stats * The alternatives for making task runners device statistics aware don't seem appealing (e.g. having task runners contain reference to hostStats) * On the alloc aggregation resource usage, I did a naive merging of task device statistics. * Personally, I question the value of such aggregation, compared to costs of struct duplication and bloating the response - but opted to be consistent in the API. * With naive concatination, device instances from a single device group used by separate tasks in the alloc, would be aggregated in two separate device group statistics. |
||
---|---|---|
.. | ||
contexts | ||
acl.go | ||
acl_test.go | ||
agent.go | ||
agent_test.go | ||
allocations.go | ||
allocations_test.go | ||
api.go | ||
api_test.go | ||
compose_test.go | ||
constraint.go | ||
constraint_test.go | ||
deployments.go | ||
evaluations.go | ||
evaluations_test.go | ||
fs.go | ||
fs_test.go | ||
jobs.go | ||
jobs_test.go | ||
jobs_testing.go | ||
namespace.go | ||
namespace_test.go | ||
nodes.go | ||
nodes_test.go | ||
operator.go | ||
operator_autopilot.go | ||
operator_autopilot_test.go | ||
operator_test.go | ||
quota.go | ||
quota_test.go | ||
raw.go | ||
regions.go | ||
regions_test.go | ||
resources.go | ||
search.go | ||
search_test.go | ||
sentinel.go | ||
sentinel_test.go | ||
status.go | ||
status_test.go | ||
system.go | ||
system_test.go | ||
tasks.go | ||
tasks_test.go | ||
util_test.go |