-
Notifications
You must be signed in to change notification settings - Fork 30
Refactor TopConsumers and add Workload and Infrastructure metrics #289
Conversation
Pull Request Test Coverage Report for Build 1055
💛 - Coveralls |
Pull Request Test Coverage Report for Build 890
💛 - Coveralls |
return `${bytes.value} ${bytes.unit}`; | ||
}; | ||
|
||
const getConsumers = (kind, results, nameLabel, formatLabel) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this would better fit to selectors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to selectors/prometheus/selectors
}; | ||
|
||
const getConsumers = metric => { | ||
const max = Math.max(...metric.consumers.map(c => c.usage)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now value will be always relative to the highest consumers, which I don't think is very useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after discussion with @jelkosz this is what we want. The first consumer bar is 100% and others are relative to the first one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I talked to @jelkosz and we concluded that it would be good to include some icon with a popover that would explain what is happening. E.g. something something, The value xy is relative to the current higest value (100% bar)
. It could also include something about the query.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
created a followup #313 - I will ask UXD for help
3912d61
to
dd78fa2
Compare
@@ -1,10 +1,51 @@ | |||
.kubevirt-consumers__bar .progress { | |||
.kubevirt-consumers__bar { | |||
height: 20px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the em units are preferable in other places as well. We should probably convert the whole dashboard to be consistent with this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
1185d99
to
dc84b25
Compare
310e20d
to
d74ba77
Compare
@suomiy @mareklibra can you please review ? |
</DashboardCardHeader> | ||
<DashboardCardBody> | ||
<ConsumersFilter> | ||
{getFormElement(typeDropdown)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be maybe good to add some margin between them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<DashboardCard> | ||
<DashboardCardHeader> | ||
<DashboardCardTitle>Top Consumers</DashboardCardTitle> | ||
<DashboardCardTitleHelp>help for top consumers</DashboardCardTitleHelp> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added Consumption bar is relative to biggest consumer which is always 100%
Not sure if that is good enough
filter !== 'All' ? metrics[metricKey].consumers.filter(c => c.kind === filter) : metrics[metricKey].consumers; | ||
const max = Math.max(...filteredConsumers.map(c => c.usage)); | ||
return filteredConsumers | ||
const getMetricConsumers = ({ consumers }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should probably go to selectors or some util class (Dashboard/TopConsumers/utils or some other utils?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getMetricConsumers
moved to Dashboard/TopConsumers/utils. The other two methods were moved to ClusterOverview/TopConsumers/utils
padding-bottom: 10px; | ||
border-bottom: 1px solid #d1d1d1; | ||
.kubevirt-consumers__dropdown-filter { | ||
width: 49%; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think margin should be more descriptive/generic than width
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im using Columns + padding as I had some issues on firefox when not using width.
- add Loading state - add Workload and Infrastructure metrics
No description provided.