Skip to content

Commit 8675b7b

Browse files
committed
Added comments describing the way graphs are made in HealthContainer.
1 parent fd2950a commit 8675b7b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

app/containers/HealthContainer.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ const HealthContainer: React.FC<HealthContainerProps> = React.memo(props => {
4444

4545
datalist.forEach((element: {}) => {
4646
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
4757
if (category === categoryName) {
4858
const categoryObj: [] = element[categoryName];
4959
for (const metricObj of categoryObj) {

0 commit comments

Comments
 (0)