Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
added VMs dropdown in top consumers card (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
Afreen R authored and rawagner committed Jun 18, 2019
1 parent 711888f commit 2536d55
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ const CONSUMERS_SLCLASSES_REQUESTED_CAPACITY_QUERY = '(sort(topk(5, sum(avg_over
const CONSUMERS_SLCLASSES_USED_CAPACITY_QUERY = '(sort(topk(5, sum(avg_over_time(kubelet_volume_stats_used_bytes[1h]) * on (namespace,persistentvolumeclaim) group_left(storageclass) kube_persistentvolumeclaim_info) by (storageclass))))[10m:1m]';
const CONSUMERS_PODS_REQUESTED_CAPACITY_QUERY = '(sort(topk(5, sum(avg_over_time(kube_persistentvolumeclaim_resource_requests_storage_bytes[1h]) * on (namespace,persistentvolumeclaim) group_left(pod) kube_pod_spec_volumes_persistentvolumeclaims_info) by (pod))))[10m:1m]';
const CONSUMERS_PODS_USED_CAPACITY_QUERY = '(sort(topk(5, sum(avg_over_time(kubelet_volume_stats_used_bytes[1h]) * on (namespace,persistentvolumeclaim) group_left(pod) kube_pod_spec_volumes_persistentvolumeclaims_info) by (pod))))[10m:1m]';
const CONSUMERS_VMS_REQUESTED_CAPACITY_QUERY = '(sort(topk(5, sum(avg_over_time(kube_persistentvolumeclaim_resource_requests_storage_bytes[1h]) * on (namespace,persistentvolumeclaim) group_left(pod) kube_pod_spec_volumes_persistentvolumeclaims_info{pod=~"virt-launcher-.*"}) by (pod))))[10m:1m]';
const CONSUMERS_VMS_USED_CAPACITY_QUERY = '(sort(topk(5, sum(max(avg_over_time(kubelet_volume_stats_used_bytes[1h]) * on (namespace,persistentvolumeclaim) group_left(pod) kube_pod_spec_volumes_persistentvolumeclaims_info{pod=~"virt-launcher-.*"}) by (pod,persistentvolumeclaim)) by (pod))))[10m:1m]';

const {
CEPH_STATUS_QUERY,
CEPH_OSD_UP_QUERY,
Expand All @@ -64,6 +67,8 @@ const PROM_RESULT_CONSTANTS = {
slClassesUsedCapacity: 'slClassesUsedCapacity',
podsRequestedCapacity: 'podsRequestedCapacity',
podsUsedCapacity: 'podsUsedCapacity',
vmsRequestedCapacity: 'vmsRequestedCapacity',
vmsUsedCapacity: 'vmsUsedCapacity',
oneHour: '[1h:10m]',
sixHours: '[6h:1h]',
twentyFourHours: '[24h:4h]',
Expand Down Expand Up @@ -176,6 +181,9 @@ export class StorageOverview extends React.Component {
fetchPrometheusQuery(CONSUMERS_SLCLASSES_USED_CAPACITY_QUERY, response => this.onFetch(PROM_RESULT_CONSTANTS.slClassesUsedCapacity, response));
fetchPrometheusQuery(CONSUMERS_PODS_REQUESTED_CAPACITY_QUERY, response => this.onFetch(PROM_RESULT_CONSTANTS.podsRequestedCapacity, response));
fetchPrometheusQuery(CONSUMERS_PODS_USED_CAPACITY_QUERY, response => this.onFetch(PROM_RESULT_CONSTANTS.podsUsedCapacity, response));

fetchPrometheusQuery(CONSUMERS_VMS_REQUESTED_CAPACITY_QUERY, response => this.onFetch(PROM_RESULT_CONSTANTS.vmsRequestedCapacity, response));
fetchPrometheusQuery(CONSUMERS_VMS_USED_CAPACITY_QUERY, response => this.onFetch(PROM_RESULT_CONSTANTS.vmsUsedCapacity, response));
}

if (getAlertManagerBaseURL()) {
Expand Down

0 comments on commit 2536d55

Please sign in to comment.