sureshanaparti commented on a change in pull request #4958:
URL: https://github.com/apache/cloudstack/pull/4958#discussion_r622158407



##########
File path: 
plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/utils/linux/KVMHostInfo.java
##########
@@ -78,11 +80,12 @@ public long getOverCommitMemory() {
     }
 
     protected static long getCpuSpeed(final NodeInfo nodeInfo) {
-        try (final Reader reader = new FileReader(
-                "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq")) {
-            return Long.parseLong(IOUtils.toString(reader).trim()) / 1000;
+        try (Reader reader = new FileReader(cpuInfoMaxFreqFileName)) {
+            Long cpuInfoMaxFreq = 
Long.parseLong(IOUtils.toString(reader).trim());
+            LOGGER.info(String.format("Retrieved value [%s] from file [%s]. 
Using the value divided by 1000 [%s] as CPU speed value.", cpuInfoMaxFreq, 
cpuInfoMaxFreqFileName, cpuInfoMaxFreq / 1000));

Review comment:
       you can log the value, i think no need to explicitly specify 'divided by 
1000'




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to