@@ -39,29 +39,35 @@ 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
console . log ( 'chartData:::::::: ' , chartData ) ;
54
54
// iterate through the chartData
55
- for ( const serviceName in chartData ) {
55
+ for ( const serviceName in chartDataObj ) {
56
+ console . log ( 'SERVICENAME: ' , serviceName ) ;
56
57
// define the metrics for this service
57
- const metrics = chartData [ serviceName ] ;
58
+ const metrics = chartDataObj [ serviceName ] ;
59
+ console . log ( 'METRICS: ' , metrics ) ;
58
60
// loop through the list of metrics for the current service
59
61
for ( const metricName in metrics ) {
62
+ console . log ( 'METRICNAME: ' , metricName ) ;
60
63
// define the value and time arrays; allow data to be reassignable in case we need to convert the bytes data into megabytes
61
64
let dataArray = metrics [ metricName ] . value ;
65
+ console . log ( 'DATAARRAY: ' , dataArray ) ;
62
66
const timeArray = metrics [ metricName ] . time ;
67
+ console . log ( 'TIMEARRAY: ' , timeArray ) ;
63
68
// specifically for `Megabyte` types, convert the original data of bytes into a value of megabytes before graphing
64
- if ( dataType === 'Memory in Megabytes' || 'Cache in Megabytes' ) {
69
+ if ( dataType === 'Memory in Megabytes' || dataType === 'Cache in Megabytes' ) {
70
+ console . log ( 'DATATYPE: ' , dataType ) ;
65
71
dataArray = dataArray . map ( value => ( value / 1000000 ) . toFixed ( 2 ) ) ;
66
72
}
67
73
// create the plotly object
@@ -75,6 +81,7 @@ const HealthChart: React.FC<HealthChartProps> = React.memo(props => {
75
81
colors : [ '#fc4039' , '#4b54ea' , '#32b44f' , '#3788fc' , '#9c27b0' , '#febc2c' ] ,
76
82
} ,
77
83
} ;
84
+ console . log ( 'PLOTLYDATAOBJECT: ' , plotlyDataObject )
78
85
// push the dataObject into the arrayOfPlotlyDataObjects
79
86
arrayOfPlotlyDataObjects . push ( plotlyDataObject ) ;
80
87
}
0 commit comments