Skip to content

Commit 6dcc198

Browse files
committed
fixed comments
1 parent 8eac19b commit 6dcc198

File tree

16 files changed

+38
-200
lines changed

16 files changed

+38
-200
lines changed

app/charts/DockerChart.tsx

Lines changed: 0 additions & 66 deletions
This file was deleted.

app/charts/GrafanaEventChart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type TimeFrame = '5m' | '15m' | '30m' | '1h' | '2h' | '1d' | '2d';
1818

1919
/**
2020
* @params {EventChartProps} props - the props object containing relevant data.
21-
* @desc Handles k8s metrics. Memoized component to generate event chart with formatted data
21+
* @desc Handles k8s and container metrics. Memoized component to generate event chart with formatted data
2222
* @returns {JSX.Element} The JSX element with the event chart.
2323
*/
2424
const GrafanaEventChart: React.FC<EventChartProps> = React.memo(props => {

app/charts/RouteChart.jsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
/** From Version 5.2 Team:
2-
* This file does not seem to be showing any data.
3-
* Hope a future team figures it out.
4-
* Best of luck!
5-
*/
6-
71
import { makeStyles } from '@material-ui/core/styles';
82
import React, { useContext } from 'react';
93
import Graph from 'react-graph-vis';
@@ -154,12 +148,6 @@ const RouteChart = React.memo(() => {
154148
},
155149
};
156150

157-
// const events = {
158-
// select(event) {
159-
// const { nodes, edges } = event;
160-
// },
161-
// };
162-
163151
if (communicationsData.length > 0 && communicationsData[0].endpoint !== '/') {
164152
return (
165153
<div className="traceContainer">
@@ -168,7 +156,6 @@ const RouteChart = React.memo(() => {
168156
className={classes.paper}
169157
graph={graph}
170158
options={options}
171-
// events={events}
172159
style={{
173160
fontFamily: 'Roboto',
174161
boxShadow: '3px 3px 6px 1px rgb(175, 175, 175)',

app/components/About.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const About: React.FC = React.memo(() => {
1414
* Feel free to change the header for the list of names.
1515
*
1616
*/
17-
const nameArray: JSX.Element[] = ['Brisa', 'Kelsi', 'Lucie', 'Jeffrey', 'Justin'].map(name => {
17+
const nameArray: JSX.Element[] = ['Haoyu', 'Eisha', 'Edwin', 'Tyler'].map(name => {
1818
return (
1919
<span style={currentMode} className="text">
2020
<p>{`${name}`}</p>
@@ -49,7 +49,8 @@ const About: React.FC = React.memo(() => {
4949
<p style={currentMode} className="text">
5050
Snow, Taylor, Tim, Roberto, Nachiket, Tiffany, Bruno, Danny, Vince, Matt, Derek, Kit,
5151
Grace, Jen, Patty, Stella, Michael, Ronelle, Todd, Greg, Brianna, Brian, Alon, Alan,
52-
Ousman, Ben, Chris, Jenae, Tim, Kirk, Jess, William, Alexander, Elisa, Josh, Troy, Gahl
52+
Ousman, Ben, Chris, Jenae, Tim, Kirk, Jess, William, Alexander, Elisa, Josh, Troy, Gahl,
53+
Brisa, Kelsi, Lucie, Jeffrey, Justin
5354
</p>
5455
<br />
5556
</div>

app/components/Occupied.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/** From Version 5.2 Team:
22
* We only fixed linting issues regarding Notifications.
33
* Otherwise, Notifications still does not function properly.
4-
* Good luck!
54
*/
65

76
/* eslint-disable jsx-a11y/label-has-associated-control */

app/containers/DockerHealthContainer.tsx

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ interface HealthContainerProps {
99
sizing: string;
1010
colourGenerator: Function;
1111
category: string;
12-
//currentService: string;
1312
}
1413

1514
interface Params {
@@ -38,10 +37,6 @@ const DockerHealthContainer: React.FC<HealthContainerProps> = React.memo(props =
3837
const [currChunk, setCurrChunk] = useState<JSX.Element[]>([]);
3938
const chunkSize = 7;
4039
let [isGrafana, setIsGrafana] = useState(false);
41-
/**
42-
* This function filters the selectedMetrics array down to only metrics that match the category of this instance of HealthContainer.
43-
* Once that has finished, it then filters the healthData down to the current category and the filteredMetrics.
44-
*/
4540

4641
function nextChunk() {
4742
const nextChunk = healthChartsArr.slice(currIndex, currIndex + chunkSize);
@@ -55,7 +50,7 @@ const DockerHealthContainer: React.FC<HealthContainerProps> = React.memo(props =
5550
}
5651

5752
const filterSelectedMetricsAndHealthData = (): DockerDataObject => {
58-
// define a filtered health data object for output
53+
// define a filtered docker data object for output
5954
// define an array of filteredMetricNames for later use
6055
const filteredHealthData = {};
6156
const filteredMetricNames: string[] = [];
@@ -79,7 +74,7 @@ const DockerHealthContainer: React.FC<HealthContainerProps> = React.memo(props =
7974
filteredHealthData[service] = {};
8075
const categoryObjects = healthData[service];
8176
for (const categoryName in categoryObjects) {
82-
// if the category in healthData matches the category passed down to this HealthContainer, iterate over the related metrics
77+
// if the category in healthData matches the category passed down to this DockerHealthContainer, iterate over the related metrics
8378
if (categoryName === category) {
8479
const metricObjects = categoryObjects[categoryName];
8580
for (const metric in metricObjects) {
@@ -107,9 +102,7 @@ const DockerHealthContainer: React.FC<HealthContainerProps> = React.memo(props =
107102

108103
// function to generate charts using the type-sorted data
109104
const generateHealthCharts = (sortedData: DockerDataObject): void => {
110-
//onst chartsArray: JSX.Element[] = [];
111105
const grafanaChartsArray: JSX.Element[] = [];
112-
//let parsedName: string = '';
113106
const keymaker = () => {
114107
return Math.floor(Math.random() * 1000);
115108
};
@@ -120,17 +113,7 @@ const DockerHealthContainer: React.FC<HealthContainerProps> = React.memo(props =
120113
// pass down the value of the current data type and service
121114
const chartData = metricObjects[metricName];
122115
const token = chartData.token;
123-
// chartsArray.push(
124-
// <HealthChart
125-
// key={'H' + keymaker()}
126-
// dataType={dataType}
127-
// serviceName={serviceName}
128-
// chartData={chartData}
129-
// categoryName={category}
130-
// sizing={sizing}
131-
// colourGenerator={colourGenerator}
132-
// />
133-
// );
116+
134117
console.log("plotting grafana")
135118
grafanaChartsArray.push(
136119
<GrafanaEventChart metricName={metricName} token={token} />);
@@ -146,16 +129,12 @@ const DockerHealthContainer: React.FC<HealthContainerProps> = React.memo(props =
146129
useEffect(() => {
147130
// returns an object containing only the healthData for the current category and the metrics the User selected
148131
const filteredHealthData = filterSelectedMetricsAndHealthData();
149-
// returns an object containing the filtered data sorted by data type
150-
//const typeSortedHealthData = healthDataGroupedByDataType(filteredHealthData);
151132
// invoking generateCharts with the sorted data will update healthChartsArr in state with the list of charts to be rendered
152133
generateHealthCharts(filteredHealthData);
153134
}, [category]);
154135

155-
// JJ-ADDITION
156136
return (
157137
<div>
158-
{/* <div id="grafana" onClick={() => { setIsGrafana(!isGrafana) }}>Grafana</div> */}
159138
{service.includes('kafkametrics') || service.includes('kubernetesmetrics') || service.includes('books') || service.includes('customers') || service.includes('frontend') || service.includes('orders')? currChunk : []}
160139
{healthChartsArr.length > chunkSize && (
161140
<>

app/containers/EventContainer.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,8 @@ const EventContainer: React.FC<EventContainerProps> = React.memo(props => {
5252
setCurrIndex(currIndex - chunkSize);
5353
}
5454

55-
/*
56-
Chronos11 -- Unfortunately, eventData is not in a good place for UI/UX purposes. These charts are being rendered 1:1 with the list of metrics (over 500).
57-
These metrics are scraped and generated by Prometheus, and should be sent to a Grafana instance to be displayed with
58-
a Grafana dashboard, but we didn't realize this was happening until we were too close to launch to fix it.
59-
It would be wonderful if a future iteration could manipulate the prometheus configuration in the kubernetes example to send its data
60-
to an instance of Grafana, and integrate Grafana's dashboard into Chronos to visualize the data.
61-
*/
62-
6355
const filterSelectedEventMetricsandData = (eventDataObj: EventDataObject): EventDataObject => {
6456
const filteredEventData = {};
65-
// there's only one element in the selected metrics array for now...
66-
// selectedMetrics is... [{Event: ['metric', 'names', 'as', 'strings']}]
6757
// use this array of selected metrics to filter the eventData down to only the metrics we want to see
6858
const selectedArr = selectedMetrics[0].Event;
6959
console.log('selectedArr IS: ', selectedArr)
@@ -108,7 +98,6 @@ const EventContainer: React.FC<EventContainerProps> = React.memo(props => {
10898
const metricObject = filteredEventDataObj[service];
10999
for (const metricName in metricObject) {
110100
console.log('metricName IS: ', metricName)
111-
//parsedName = metricName.replace(/.*\/.*\//g, '')
112101
const chartData = metricObject[metricName];
113102
console.log('chartData IS: ', chartData)
114103
const token = chartData.token;

app/containers/GraphsContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,13 @@ const GraphsContainer: React.FC = React.memo(props => {
251251
</>
252252

253253
)}
254+
{/* docker charts */}
254255
{chart.startsWith('docker_') && (
255256
<>
256257
<DockerHealthContainer colourGenerator={stringToColour} sizing="solo" category={chart.substring(7)} />
257258
</>
258259

259260
)}
260-
{chart === 'docker' && <DockerChart />}
261261
{chart === 'modifyMetrics' && <ModifyMetrics />}
262262
</div>
263263
)}

app/containers/HealthContainer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ const HealthContainer: React.FC<HealthContainerProps> = React.memo(props => {
169169
generateHealthCharts(typeSortedHealthData);
170170
}, [category]);
171171

172-
// JJ-ADDITION
173172
return (
174173
<div>
175174
{service !== 'kafkametrics' && service !== 'kubernetesmetrics' ? healthChartsArr : []}

app/context/CommsContext.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/** From Version 5.2 Team:
22
* We only cleaned up linting errors in this file.
3-
* Good luck!
43
*/
54

65
import React, { useState, useCallback } from 'react';

0 commit comments

Comments
 (0)