resources.js 1.4 KB

123456789101112131415161718192021222324252627
  1. // Cap the number of layers in the resource view to this constant. The reason why we have
  2. // this constant is not just about the style, but also helps us build the selectors.
  3. export const RESOURCE_VIEW_MAX_LAYERS = 3;
  4. // TODO: Consider fetching these from the backend.
  5. export const TOPOLOGIES_WITH_CAPACITY = ['hosts'];
  6. // TODO: These too should ideally be provided by the backend. Currently, we are showing
  7. // the same layers for all the topologies, because their number is small, but later on
  8. // we might be interested in fully customizing the layers' hierarchy per topology.
  9. export const RESOURCE_VIEW_LAYERS = {
  10. containers: ['hosts', 'containers', 'processes'],
  11. hosts: ['hosts', 'containers', 'processes'],
  12. processes: ['hosts', 'containers', 'processes'],
  13. };
  14. // TODO: These are all the common metrics that appear across all the current resource view
  15. // topologies. The reason for taking them only is that we want to get meaningful data for all
  16. // the layers. These should be taken directly from the backend report, but as their info is
  17. // currently only contained in the nodes data, it would be hard to determine them before all
  18. // the nodes for all the layers have been loaded, so we'd need to change the routing logic
  19. // since the requirement is that one these is always pinned in the resource view.
  20. export const RESOURCE_VIEW_METRICS = [
  21. { id: 'host_cpu_usage_percent', label: 'CPU' },
  22. { id: 'host_mem_usage_bytes', label: 'Memory' },
  23. ];