@@ -81,9 +81,12 @@ public DiskStats getDiskUtilizationStats() {
8181 double writeLatency = 0.0 ;
8282 double readOps = 0.0 ;
8383 double writeOps = 0.0 ;
84+ if (this .fsService .stats ().getIoStats () == null ) {
85+ return null ;
86+ }
8487 for (FsInfo .DeviceStats devicesStat : this .fsService .stats ().getIoStats ().getDevicesStats ()) {
8588 if (previousIOTimeMap != null && previousIOTimeMap .containsKey (devicesStat .getDeviceName ())){
86- logger .info (this .fsService .stats ().getTimestamp ());
89+ // logger.info(this.fsService.stats().getTimestamp());
8790 long ioSpentTime = devicesStat .getCurrentIOTime () - previousIOTimeMap .get (devicesStat .getDeviceName ()).ioTime ;
8891 ioUsePercent = (ioSpentTime * 100 ) / (1000 );
8992 readOps += devicesStat .currentReadOperations () - previousIOTimeMap .get (devicesStat .getDeviceName ()).readOps ;
@@ -104,11 +107,11 @@ public DiskStats getDiskUtilizationStats() {
104107 devicesStat .getCurrentReadKilobytes (), devicesStat .getCurrentWriteKilobytes ());
105108 currentIOTimeMap .put (devicesStat .getDeviceName (), ps );
106109 }
107- logger .info ("Read in MB : {} , Write in MB : {}" , readkb /1000 , writekb /1000 );
110+ // logger.info("Read in MB : {} , Write in MB : {}", readkb/1000, writekb/1000);
108111// readLatency += (readOps / readTime) * 100;
109112// writeLatency += (writeOps / writeTime) * 100;
110- logger .info ("read ops : {} , writeops : {} , readtime: {} , writetime: {}" , readOps , writeOps , readTime , writeTime );
111- logger .info ("Read latency : {} write latency : {}" , readLatency , writeLatency );
113+ // logger.info("read ops : {} , writeops : {} , readtime: {} , writetime: {}", readOps, writeOps, readTime, writeTime);
114+ // logger.info("Read latency : {} write latency : {}" , readLatency, writeLatency);
112115 logger .info ("IO use percent : {}" , ioUsePercent );
113116 previousIOTimeMap = currentIOTimeMap ;
114117
0 commit comments