@@ -39,28 +39,34 @@ const HealthChart: React.FC<HealthChartProps> = React.memo(props => {
39
39
} ;
40
40
41
41
// pulls the current service names to be shown in the graph title from chartData
42
- const serviceNamesAsString = ( chartData : object ) : string => {
42
+ const serviceNamesAsString = ( chartDataObject : object ) : string => {
43
43
let serviceNameString = '' ;
44
- for ( const serviceName in chartData ) {
44
+ for ( const serviceName in chartDataObject ) {
45
45
serviceNameString += `${ serviceName } | ` ;
46
46
}
47
47
return serviceNameString ;
48
48
} ;
49
49
50
50
// generates an array of plotly data objects to be passed into our plotly chart's data prop
51
- const generatePlotlyDataObjects = ( chartData : object ) : object [ ] => {
51
+ const generatePlotlyDataObjects = ( chartDataObj : object ) : object [ ] => {
52
52
const arrayOfPlotlyDataObjects : PlotlyData [ ] = [ ] ;
53
53
// iterate through the chartData
54
- for ( const serviceName in chartData ) {
54
+ for ( const serviceName in chartDataObj ) {
55
+ console . log ( 'SERVICENAME: ' , serviceName ) ;
55
56
// define the metrics for this service
56
- const metrics = chartData [ serviceName ] ;
57
+ const metrics = chartDataObj [ serviceName ] ;
58
+ console . log ( 'METRICS: ' , metrics ) ;
57
59
// loop through the list of metrics for the current service
58
60
for ( const metricName in metrics ) {
61
+ console . log ( 'METRICNAME: ' , metricName ) ;
59
62
// define the value and time arrays; allow data to be reassignable in case we need to convert the bytes data into megabytes
60
63
let dataArray = metrics [ metricName ] . value ;
64
+ console . log ( 'DATAARRAY: ' , dataArray ) ;
61
65
const timeArray = metrics [ metricName ] . time ;
66
+ console . log ( 'TIMEARRAY: ' , timeArray ) ;
62
67
// specifically for `Megabyte` types, convert the original data of bytes into a value of megabytes before graphing
63
- if ( dataType === 'Memory in Megabytes' || 'Cache in Megabytes' ) {
68
+ if ( dataType === 'Memory in Megabytes' || dataType === 'Cache in Megabytes' ) {
69
+ console . log ( 'DATATYPE: ' , dataType ) ;
64
70
dataArray = dataArray . map ( value => ( value / 1000000 ) . toFixed ( 2 ) ) ;
65
71
}
66
72
// create the plotly object
@@ -74,6 +80,7 @@ const HealthChart: React.FC<HealthChartProps> = React.memo(props => {
74
80
colors : [ '#fc4039' , '#4b54ea' , '#32b44f' , '#3788fc' , '#9c27b0' , '#febc2c' ] ,
75
81
} ,
76
82
} ;
83
+ console . log ( 'PLOTLYDATAOBJECT: ' , plotlyDataObject )
77
84
// push the dataObject into the arrayOfPlotlyDataObjects
78
85
arrayOfPlotlyDataObjects . push ( plotlyDataObject ) ;
79
86
}
0 commit comments