geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [geode] 01/03: GEODE-3716 - Adding steal time metrics to Geode.
Date Fri, 13 Oct 2017 20:45:33 GMT
This is an automated email from the ASF dual-hosted git repository.

klund pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 00da97d3451097cecbc2eb66243c195ca6d54a92
Author: Charlie Black <charliemblack@github.com>
AuthorDate: Fri Oct 6 00:47:43 2017 -0700

    GEODE-3716 - Adding steal time metrics to Geode.
---
 .../internal/statistics/platform/LinuxProcFsStatistics.java  | 12 +++++++-----
 .../geode/internal/statistics/platform/LinuxSystemStats.java |  6 +++++-
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/internal/statistics/platform/LinuxProcFsStatistics.java
b/geode-core/src/main/java/org/apache/geode/internal/statistics/platform/LinuxProcFsStatistics.java
index 0b7ec0b..27eabf3 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/statistics/platform/LinuxProcFsStatistics.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/statistics/platform/LinuxProcFsStatistics.java
@@ -33,6 +33,7 @@ public class LinuxProcFsStatistics {
     IOWAIT,
     IRQ,
     SOFTIRQ,
+    STEAL,
     /** stands for aggregation of all columns not present in the enum list */
     OTHER
   }
@@ -150,6 +151,7 @@ public class LinuxProcFsStatistics {
             ints[LinuxSystemStats.cpuNiceINT] = cpuData[CPU.NICE.ordinal()];
             ints[LinuxSystemStats.cpuSystemINT] = cpuData[CPU.SYSTEM.ordinal()];
             ints[LinuxSystemStats.cpuUserINT] = cpuData[CPU.USER.ordinal()];
+            ints[LinuxSystemStats.cpuStealINT] = cpuData[CPU.STEAL.ordinal()];
             ints[LinuxSystemStats.iowaitINT] = cpuData[CPU.IOWAIT.ordinal()];
             ints[LinuxSystemStats.irqINT] = cpuData[CPU.IRQ.ordinal()];
             ints[LinuxSystemStats.softirqINT] = cpuData[CPU.SOFTIRQ.ordinal()];
@@ -637,12 +639,12 @@ public class LinuxProcFsStatistics {
       st.skipToken(); // cpu name
       final int MAX_CPU_STATS = CPU.values().length;
       /*
-       * newer kernels now have 8 columns for cpu in /proc/stat (up from 7). This number
may
-       * increase even further, hence we now use List in place of long[]. We add up entries
from all
-       * columns after 7 into CPU.OTHER
+       * newer kernels now have 10 columns for cpu in /proc/stat. This number may increase
even
+       * further, hence we now use List in place of long[]. We add up entries from all columns
after
+       * MAX_CPU_STATS into CPU.OTHER
        */
-      List<Long> newStats = new ArrayList<Long>(8);
-      List<Long> diffs = new ArrayList<Long>(8);
+      List<Long> newStats = new ArrayList<Long>(10);
+      List<Long> diffs = new ArrayList<Long>(10);
       long total_change = 0;
       int actualCpuStats = 0;
       long unaccountedCpuUtilization = 0;
diff --git a/geode-core/src/main/java/org/apache/geode/internal/statistics/platform/LinuxSystemStats.java
b/geode-core/src/main/java/org/apache/geode/internal/statistics/platform/LinuxSystemStats.java
index f95a09d..8dbb2df 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/statistics/platform/LinuxSystemStats.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/statistics/platform/LinuxSystemStats.java
@@ -46,6 +46,7 @@ public class LinuxSystemStats {
   final static int cachedMemoryINT = 16;
   final static int dirtyMemoryINT = 17;
   final static int cpuNonUserINT = 18;
+  final static int cpuStealINT = 19;
 
   final static int loopbackPacketsLONG = 0;
   final static int loopbackBytesLONG = 1;
@@ -143,7 +144,9 @@ public class LinuxSystemStats {
             f.createIntGauge("cpuNonUser",
                 "The percentage of total available time that has been used to execute non-user
code.(includes system, iowait, irq, softirq etc.)",
                 "%"),
-
+            f.createIntGauge("cpuSteal",
+                "Stolen time, which is the time spent in their operating systems when running
in a virtualized environment.",
+                "%"),
 
             f.createLongCounter("loopbackPackets",
                 "The number of network packets sent (or received) on the loopback interface",
@@ -245,6 +248,7 @@ public class LinuxSystemStats {
     checkOffset("cachedMemory", cachedMemoryINT);
     checkOffset("dirtyMemory", dirtyMemoryINT);
     checkOffset("cpuNonUser", cpuNonUserINT);
+    checkOffset("cpuSteal", cpuStealINT);
 
     checkOffset("loopbackPackets", loopbackPacketsLONG);
     checkOffset("loopbackBytes", loopbackBytesLONG);

-- 
To stop receiving notification emails like this one, please contact
"commits@geode.apache.org" <commits@geode.apache.org>.

Mime
View raw message