File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,16 @@ const HealthContainer: React.FC<HealthContainerProps> = React.memo(props => {
44
44
45
45
datalist . forEach ( ( element : { } ) => {
46
46
const categoryName : string = Object . keys ( element ) [ 0 ] ;
47
+ // 'element' is the category found in the datalist response from the server query for metrics data
48
+ // the above forEach method loops through the different categories
49
+ // 'category' variable is the specific category passed in to HealthContainer via prop drilling
50
+ // 'category' is the string Memory, CPU, or others that are in the Category column of the Query Selector interface
51
+ // 'categoryName' is the string that is Memory/CPU/other inside the metrics data response
52
+ // when the 'element'/'categoryName' matches the 'category' selected in the Query Selection interface...
53
+ // ... it will dive into that object to pull out a chart for each metric selected in the selection interface
54
+ // selectedMetricsList is derived from the selectedMetrics that were in the QueryContext
55
+ // selectedMetricsList is how we know which metrics should be made into a chart
56
+ // selectedMetricsList is the way we can give one chart the multiple metrics being requested
47
57
if ( category === categoryName ) {
48
58
const categoryObj : [ ] = element [ categoryName ] ;
49
59
for ( const metricObj of categoryObj ) {
You can’t perform that action at this time.
0 commit comments