File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
frontend/src/pages/MCADashboard/Metrics/api Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export const getMetricData = async (query: string) => {
1010 try {
1111 const body = { query : query } ;
1212 const res : { data : { value : [ string , number ] } [ ] } = await axios . post ( '/api/metrics-data' , body ) ;
13- if ( query === utilizedGPUQuery ) { // since vector(0) in query, even if no gpu returns 0
13+ if ( query === utilizedGPUQuery ) { // since vector(0) in query, even if no gpu in cluster returns 0
1414 const gpubody = { query : utilizedGPUMemoryQuery } ; // use the utilizedGPUMemoryQuery to verify gpu is present in the cluster
1515 const gpures : { data : { value : [ string , number ] } [ ] } = await axios . post ( '/api/metrics-data' , gpubody ) ;
1616 if ( gpures . data && gpures . data [ 0 ] && gpures . data [ 0 ] . value && gpures . data [ 0 ] . value [ 1 ] !== undefined ) {
@@ -22,7 +22,11 @@ export const getMetricData = async (query: string) => {
2222 if ( res . data && res . data [ 0 ] && res . data [ 0 ] . value && res . data [ 0 ] . value [ 1 ] !== undefined ) {
2323 return res . data [ 0 ] . value [ 1 ] ;
2424 } else {
25- return noGpu ;
25+ if ( query === utilizedGPUMemoryQuery ) {
26+ return noGpu ;
27+ } else {
28+ return 0 ;
29+ }
2630 }
2731 }
2832 } catch ( error ) {
You can’t perform that action at this time.
0 commit comments