changeset 1366:ad1f6b074c0c

Rename c.r.t.utils to c.r.t.agent.utils Reviewed-by: vanaltj Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2013-November/008945.html
author Omair Majid <omajid@redhat.com>
date Mon, 25 Nov 2013 19:01:03 -0500
parents bfe135192880
children 07becc24f34d
files README.api agent/core/pom.xml agent/core/src/main/java/com/redhat/thermostat/agent/utils/ProcDataSource.java agent/core/src/main/java/com/redhat/thermostat/agent/utils/SysConf.java agent/core/src/main/java/com/redhat/thermostat/utils/ProcDataSource.java agent/core/src/main/java/com/redhat/thermostat/utils/SysConf.java agent/core/src/test/java/com/redhat/thermostat/agent/utils/ProcDataSourceTest.java agent/core/src/test/java/com/redhat/thermostat/agent/utils/SysConfTest.java agent/core/src/test/java/com/redhat/thermostat/utils/ProcDataSourceTest.java agent/core/src/test/java/com/redhat/thermostat/utils/SysConfTest.java host-cpu/agent/src/main/java/com/redhat/thermostat/host/cpu/agent/internal/CpuStatBuilder.java host-cpu/agent/src/main/java/com/redhat/thermostat/host/cpu/agent/internal/HostCpuBackend.java host-cpu/agent/src/test/java/com/redhat/thermostat/host/cpu/agent/internal/CpuStatBuilderTest.java host-memory/agent/src/main/java/com/redhat/thermostat/host/memory/agent/internal/HostMemoryBackend.java host-memory/agent/src/main/java/com/redhat/thermostat/host/memory/agent/internal/MemoryStatBuilder.java host-memory/agent/src/test/java/com/redhat/thermostat/host/memory/agent/internal/MemoryStatBuilderTest.java system-backend/src/main/java/com/redhat/thermostat/backend/system/HostInfoBuilder.java system-backend/src/main/java/com/redhat/thermostat/backend/system/JvmStatHostListener.java system-backend/src/main/java/com/redhat/thermostat/backend/system/ProcessEnvironmentBuilder.java system-backend/src/main/java/com/redhat/thermostat/backend/system/ProcessUserInfoBuilder.java system-backend/src/main/java/com/redhat/thermostat/backend/system/SystemBackend.java system-backend/src/test/java/com/redhat/thermostat/backend/system/HostInfoBuilderTest.java system-backend/src/test/java/com/redhat/thermostat/backend/system/ProcessEnvironmentBuilderTest.java system-backend/src/test/java/com/redhat/thermostat/backend/system/ProcessUserInfoBuilderTest.java vm-cpu/agent/src/main/java/com/redhat/thermostat/vm/cpu/agent/internal/ProcessStatusInfoBuilder.java vm-cpu/agent/src/main/java/com/redhat/thermostat/vm/cpu/agent/internal/VmCpuBackend.java vm-cpu/agent/src/test/java/com/redhat/thermostat/vm/cpu/agent/internal/ProcessStatusInfoBuilderTest.java
diffstat 27 files changed, 358 insertions(+), 358 deletions(-) [+]
line wrap: on
line diff
--- a/README.api	Mon Nov 25 18:59:50 2013 -0500
+++ b/README.api	Mon Nov 25 19:01:03 2013 -0500
@@ -6,6 +6,7 @@
  - com.redhat.thermostat.agent
  - com.redhat.thermostat.agent.command
  - com.redhat.thermostat.agent.config
+ - com.redhat.thermostat.agent.utils
  - com.redhat.thermostat.annotations
  - com.redhat.thermostat.backend
  - com.redhat.thermostat.client.cli
@@ -38,7 +39,6 @@
  - com.redhat.thermostat.storage.model
  - com.redhat.thermostat.storage.monitor
  - com.redhat.thermostat.storage.query
- - com.redhat.thermostat.utils
  - com.redhat.thermostat.utils.hostname
  - com.redhat.thermostat.utils.keyring
  - com.redhat.thermostat.utils.management
--- a/agent/core/pom.xml	Mon Nov 25 18:59:50 2013 -0500
+++ b/agent/core/pom.xml	Mon Nov 25 19:01:03 2013 -0500
@@ -125,9 +125,9 @@
             <Export-Package>
               com.redhat.thermostat.agent,
               com.redhat.thermostat.agent.config,
+              com.redhat.thermostat.agent.utils,
               com.redhat.thermostat.backend,
               com.redhat.thermostat.utils.hostname,
-              com.redhat.thermostat.utils,
               com.redhat.thermostat.utils.management,
               com.redhat.thermostat.utils.username,
             </Export-Package>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agent/core/src/main/java/com/redhat/thermostat/agent/utils/ProcDataSource.java	Mon Nov 25 19:01:03 2013 -0500
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.agent.utils;
+
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.Reader;
+
+/**
+ * Wrapper for files under /proc. See proc(5) for details about this.
+ */
+public class ProcDataSource {
+
+    private static final String LOAD_FILE = "/proc/loadavg";
+    private static final String STAT_FILE = "/proc/stat";
+    private static final String MEMINFO_FILE = "/proc/meminfo";
+    private static final String CPUINFO_FILE = "/proc/cpuinfo";
+
+    private static final String PID_STAT_FILE = "/proc/${pid}/stat";
+    private static final String PID_STATUS_FILE = "/proc/${pid}/status";
+    private static final String PID_ENVIRON_FILE = "/proc/${pid}/environ";
+
+    /**
+     * Returns a reader for /proc/cpuinfo
+     */
+    public Reader getCpuInfoReader() throws IOException {
+        return new FileReader(CPUINFO_FILE);
+    }
+
+    /**
+     * Returns a reader for /proc/loadavg
+     */
+    public Reader getCpuLoadReader() throws IOException {
+        return new FileReader(LOAD_FILE);
+    }
+
+    /**
+     * Returns a reader for /proc/stat. Kernel/System statistics.
+     */
+    public Reader getStatReader() throws IOException {
+        return new FileReader(STAT_FILE);
+    }
+
+    /**
+     * Returns a reader for /proc/meminfo
+     */
+    public Reader getMemInfoReader() throws IOException {
+        return new FileReader(MEMINFO_FILE);
+    }
+
+    /**
+     * Returns a reader for /proc/$PID/stat
+     */
+    public Reader getStatReader(int pid) throws IOException {
+        return new FileReader(getPidFile(PID_STAT_FILE, pid));
+    }
+    
+    /**
+     * Returns a reader for /proc/$PID/status
+     */
+    public Reader getStatusReader(int pid) throws IOException {
+        return new FileReader(getPidFile(PID_STATUS_FILE, pid));
+    }
+
+    /**
+     * Returns a reader for /proc/$PID/environ
+     */
+    public Reader getEnvironReader(int pid) throws IOException {
+        return new FileReader(getPidFile(PID_ENVIRON_FILE, pid));
+    }
+
+    private String getPidFile(String fileName, int pid) {
+        return fileName.replace("${pid}", Integer.toString(pid));
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agent/core/src/main/java/com/redhat/thermostat/agent/utils/SysConf.java	Mon Nov 25 19:01:03 2013 -0500
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.agent.utils;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+/**
+ * A wrapper over POSIX's sysconf.
+ * <p>
+ * Implementation notes: uses {@code getconf(1)}
+ */
+public class SysConf {
+
+    private SysConf() {
+        /* do not initialize */
+    }
+
+    public static long getClockTicksPerSecond() {
+        String ticks = sysConf("CLK_TCK");
+        try {
+            return Long.valueOf(ticks);
+        } catch (NumberFormatException nfe) {
+            return 0;
+        }
+    }
+
+    private static String sysConf(String arg) {
+        BufferedReader reader = null;
+        try {
+            Process process = Runtime.getRuntime().exec(new String[] { "getconf", arg });
+            int result = process.waitFor();
+            if (result != 0) {
+                return null;
+            }
+            reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
+            return reader.readLine();
+        } catch (IOException e) {
+            return null;
+        } catch (InterruptedException e) {
+            return null;
+        } finally {
+            if (reader != null) {
+                try {
+                    reader.close();
+                } catch (IOException e) {
+                    // TODO
+                }
+            }
+        }
+    }
+}
+
--- a/agent/core/src/main/java/com/redhat/thermostat/utils/ProcDataSource.java	Mon Nov 25 18:59:50 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.utils;
-
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.Reader;
-
-/**
- * Wrapper for files under /proc. See proc(5) for details about this.
- */
-public class ProcDataSource {
-
-    private static final String LOAD_FILE = "/proc/loadavg";
-    private static final String STAT_FILE = "/proc/stat";
-    private static final String MEMINFO_FILE = "/proc/meminfo";
-    private static final String CPUINFO_FILE = "/proc/cpuinfo";
-
-    private static final String PID_STAT_FILE = "/proc/${pid}/stat";
-    private static final String PID_STATUS_FILE = "/proc/${pid}/status";
-    private static final String PID_ENVIRON_FILE = "/proc/${pid}/environ";
-
-    /**
-     * Returns a reader for /proc/cpuinfo
-     */
-    public Reader getCpuInfoReader() throws IOException {
-        return new FileReader(CPUINFO_FILE);
-    }
-
-    /**
-     * Returns a reader for /proc/loadavg
-     */
-    public Reader getCpuLoadReader() throws IOException {
-        return new FileReader(LOAD_FILE);
-    }
-
-    /**
-     * Returns a reader for /proc/stat. Kernel/System statistics.
-     */
-    public Reader getStatReader() throws IOException {
-        return new FileReader(STAT_FILE);
-    }
-
-    /**
-     * Returns a reader for /proc/meminfo
-     */
-    public Reader getMemInfoReader() throws IOException {
-        return new FileReader(MEMINFO_FILE);
-    }
-
-    /**
-     * Returns a reader for /proc/$PID/stat
-     */
-    public Reader getStatReader(int pid) throws IOException {
-        return new FileReader(getPidFile(PID_STAT_FILE, pid));
-    }
-    
-    /**
-     * Returns a reader for /proc/$PID/status
-     */
-    public Reader getStatusReader(int pid) throws IOException {
-        return new FileReader(getPidFile(PID_STATUS_FILE, pid));
-    }
-
-    /**
-     * Returns a reader for /proc/$PID/environ
-     */
-    public Reader getEnvironReader(int pid) throws IOException {
-        return new FileReader(getPidFile(PID_ENVIRON_FILE, pid));
-    }
-
-    private String getPidFile(String fileName, int pid) {
-        return fileName.replace("${pid}", Integer.toString(pid));
-    }
-
-}
-
--- a/agent/core/src/main/java/com/redhat/thermostat/utils/SysConf.java	Mon Nov 25 18:59:50 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.utils;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-
-/**
- * A wrapper over POSIX's sysconf.
- * <p>
- * Implementation notes: uses {@code getconf(1)}
- */
-public class SysConf {
-
-    private SysConf() {
-        /* do not initialize */
-    }
-
-    public static long getClockTicksPerSecond() {
-        String ticks = sysConf("CLK_TCK");
-        try {
-            return Long.valueOf(ticks);
-        } catch (NumberFormatException nfe) {
-            return 0;
-        }
-    }
-
-    private static String sysConf(String arg) {
-        BufferedReader reader = null;
-        try {
-            Process process = Runtime.getRuntime().exec(new String[] { "getconf", arg });
-            int result = process.waitFor();
-            if (result != 0) {
-                return null;
-            }
-            reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
-            return reader.readLine();
-        } catch (IOException e) {
-            return null;
-        } catch (InterruptedException e) {
-            return null;
-        } finally {
-            if (reader != null) {
-                try {
-                    reader.close();
-                } catch (IOException e) {
-                    // TODO
-                }
-            }
-        }
-    }
-}
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agent/core/src/test/java/com/redhat/thermostat/agent/utils/ProcDataSourceTest.java	Mon Nov 25 19:01:03 2013 -0500
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.agent.utils;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.io.IOException;
+import java.io.Reader;
+
+import org.junit.Test;
+
+import com.redhat.thermostat.agent.utils.ProcDataSource;
+import com.redhat.thermostat.testutils.TestUtils;
+
+public class ProcDataSourceTest {
+
+    @Test
+    public void testGetCpuInfoReader() throws IOException {
+        Reader r = new ProcDataSource().getCpuInfoReader();
+        assertNotNull(r);
+    }
+
+    @Test
+    public void testGetCpuLoadReader() throws IOException {
+        Reader r = new ProcDataSource().getCpuLoadReader();
+        assertNotNull(r);
+    }
+
+    @Test
+    public void testGetMemInfoReader() throws IOException {
+        Reader r = new ProcDataSource().getMemInfoReader();
+        assertNotNull(r);
+    }
+
+    @Test
+    public void testGetStatReader() throws IOException {
+        int pid = TestUtils.getProcessId();
+        Reader r = new ProcDataSource().getStatReader(pid);
+        assertNotNull(r);
+    }
+
+
+    @Test
+    public void testGetEnvironReader() throws IOException {
+        int pid = TestUtils.getProcessId();
+        Reader r = new ProcDataSource().getEnvironReader(pid);
+        assertNotNull(r);
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/agent/core/src/test/java/com/redhat/thermostat/agent/utils/SysConfTest.java	Mon Nov 25 19:01:03 2013 -0500
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.agent.utils;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+import com.redhat.thermostat.agent.utils.SysConf;
+
+public class SysConfTest {
+
+    @Test
+    public void test() {
+        long ticksPerSecond = SysConf.getClockTicksPerSecond();
+        assertTrue(ticksPerSecond >= 1);
+    }
+}
+
--- a/agent/core/src/test/java/com/redhat/thermostat/utils/ProcDataSourceTest.java	Mon Nov 25 18:59:50 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.utils;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.io.IOException;
-import java.io.Reader;
-
-import org.junit.Test;
-
-import com.redhat.thermostat.testutils.TestUtils;
-import com.redhat.thermostat.utils.ProcDataSource;
-
-public class ProcDataSourceTest {
-
-    @Test
-    public void testGetCpuInfoReader() throws IOException {
-        Reader r = new ProcDataSource().getCpuInfoReader();
-        assertNotNull(r);
-    }
-
-    @Test
-    public void testGetCpuLoadReader() throws IOException {
-        Reader r = new ProcDataSource().getCpuLoadReader();
-        assertNotNull(r);
-    }
-
-    @Test
-    public void testGetMemInfoReader() throws IOException {
-        Reader r = new ProcDataSource().getMemInfoReader();
-        assertNotNull(r);
-    }
-
-    @Test
-    public void testGetStatReader() throws IOException {
-        int pid = TestUtils.getProcessId();
-        Reader r = new ProcDataSource().getStatReader(pid);
-        assertNotNull(r);
-    }
-
-
-    @Test
-    public void testGetEnvironReader() throws IOException {
-        int pid = TestUtils.getProcessId();
-        Reader r = new ProcDataSource().getEnvironReader(pid);
-        assertNotNull(r);
-    }
-
-}
-
--- a/agent/core/src/test/java/com/redhat/thermostat/utils/SysConfTest.java	Mon Nov 25 18:59:50 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright 2012, 2013 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.utils;
-
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-import com.redhat.thermostat.utils.SysConf;
-
-public class SysConfTest {
-
-    @Test
-    public void test() {
-        long ticksPerSecond = SysConf.getClockTicksPerSecond();
-        assertTrue(ticksPerSecond >= 1);
-    }
-}
-
--- a/host-cpu/agent/src/main/java/com/redhat/thermostat/host/cpu/agent/internal/CpuStatBuilder.java	Mon Nov 25 18:59:50 2013 -0500
+++ b/host-cpu/agent/src/main/java/com/redhat/thermostat/host/cpu/agent/internal/CpuStatBuilder.java	Mon Nov 25 19:01:03 2013 -0500
@@ -41,11 +41,11 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import com.redhat.thermostat.agent.utils.ProcDataSource;
 import com.redhat.thermostat.common.Clock;
 import com.redhat.thermostat.common.utils.LoggingUtils;
 import com.redhat.thermostat.host.cpu.common.model.CpuStat;
 import com.redhat.thermostat.storage.core.WriterID;
-import com.redhat.thermostat.utils.ProcDataSource;
 
 public class CpuStatBuilder {
 
--- a/host-cpu/agent/src/main/java/com/redhat/thermostat/host/cpu/agent/internal/HostCpuBackend.java	Mon Nov 25 18:59:50 2013 -0500
+++ b/host-cpu/agent/src/main/java/com/redhat/thermostat/host/cpu/agent/internal/HostCpuBackend.java	Mon Nov 25 19:01:03 2013 -0500
@@ -39,14 +39,14 @@
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 
+import com.redhat.thermostat.agent.utils.ProcDataSource;
+import com.redhat.thermostat.agent.utils.SysConf;
 import com.redhat.thermostat.backend.BaseBackend;
 import com.redhat.thermostat.common.Clock;
 import com.redhat.thermostat.common.SystemClock;
 import com.redhat.thermostat.common.Version;
 import com.redhat.thermostat.host.cpu.common.CpuStatDAO;
 import com.redhat.thermostat.storage.core.WriterID;
-import com.redhat.thermostat.utils.ProcDataSource;
-import com.redhat.thermostat.utils.SysConf;
 
 public class HostCpuBackend extends BaseBackend {
 
--- a/host-cpu/agent/src/test/java/com/redhat/thermostat/host/cpu/agent/internal/CpuStatBuilderTest.java	Mon Nov 25 18:59:50 2013 -0500
+++ b/host-cpu/agent/src/test/java/com/redhat/thermostat/host/cpu/agent/internal/CpuStatBuilderTest.java	Mon Nov 25 19:01:03 2013 -0500
@@ -49,11 +49,11 @@
 
 import org.junit.Test;
 
+import com.redhat.thermostat.agent.utils.ProcDataSource;
 import com.redhat.thermostat.common.Clock;
 import com.redhat.thermostat.common.SystemClock;
 import com.redhat.thermostat.host.cpu.common.model.CpuStat;
 import com.redhat.thermostat.storage.core.WriterID;
-import com.redhat.thermostat.utils.ProcDataSource;
 
 public class CpuStatBuilderTest {
 
--- a/host-memory/agent/src/main/java/com/redhat/thermostat/host/memory/agent/internal/HostMemoryBackend.java	Mon Nov 25 18:59:50 2013 -0500
+++ b/host-memory/agent/src/main/java/com/redhat/thermostat/host/memory/agent/internal/HostMemoryBackend.java	Mon Nov 25 19:01:03 2013 -0500
@@ -39,11 +39,11 @@
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 
+import com.redhat.thermostat.agent.utils.ProcDataSource;
 import com.redhat.thermostat.backend.BaseBackend;
 import com.redhat.thermostat.common.Version;
 import com.redhat.thermostat.host.memory.common.MemoryStatDAO;
 import com.redhat.thermostat.storage.core.WriterID;
-import com.redhat.thermostat.utils.ProcDataSource;
 
 public class HostMemoryBackend extends BaseBackend {
 
--- a/host-memory/agent/src/main/java/com/redhat/thermostat/host/memory/agent/internal/MemoryStatBuilder.java	Mon Nov 25 18:59:50 2013 -0500
+++ b/host-memory/agent/src/main/java/com/redhat/thermostat/host/memory/agent/internal/MemoryStatBuilder.java	Mon Nov 25 19:01:03 2013 -0500
@@ -41,12 +41,12 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import com.redhat.thermostat.agent.utils.ProcDataSource;
 import com.redhat.thermostat.common.NotImplementedException;
 import com.redhat.thermostat.common.Size;
 import com.redhat.thermostat.common.utils.LoggingUtils;
 import com.redhat.thermostat.host.memory.common.model.MemoryStat;
 import com.redhat.thermostat.storage.core.WriterID;
-import com.redhat.thermostat.utils.ProcDataSource;
 
 /**
  * Implementation note: uses information from /proc/
--- a/host-memory/agent/src/test/java/com/redhat/thermostat/host/memory/agent/internal/MemoryStatBuilderTest.java	Mon Nov 25 18:59:50 2013 -0500
+++ b/host-memory/agent/src/test/java/com/redhat/thermostat/host/memory/agent/internal/MemoryStatBuilderTest.java	Mon Nov 25 19:01:03 2013 -0500
@@ -49,9 +49,9 @@
 import org.junit.Before;
 import org.junit.Test;
 
+import com.redhat.thermostat.agent.utils.ProcDataSource;
 import com.redhat.thermostat.host.memory.common.model.MemoryStat;
 import com.redhat.thermostat.storage.core.WriterID;
-import com.redhat.thermostat.utils.ProcDataSource;
 
 public class MemoryStatBuilderTest {
 
--- a/system-backend/src/main/java/com/redhat/thermostat/backend/system/HostInfoBuilder.java	Mon Nov 25 18:59:50 2013 -0500
+++ b/system-backend/src/main/java/com/redhat/thermostat/backend/system/HostInfoBuilder.java	Mon Nov 25 19:01:03 2013 -0500
@@ -43,12 +43,12 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import com.redhat.thermostat.agent.utils.ProcDataSource;
 import com.redhat.thermostat.common.Size;
 import com.redhat.thermostat.common.Size.Unit;
 import com.redhat.thermostat.common.utils.LoggingUtils;
 import com.redhat.thermostat.storage.core.WriterID;
 import com.redhat.thermostat.storage.model.HostInfo;
-import com.redhat.thermostat.utils.ProcDataSource;
 import com.redhat.thermostat.utils.hostname.HostName;
 
 public class HostInfoBuilder {
--- a/system-backend/src/main/java/com/redhat/thermostat/backend/system/JvmStatHostListener.java	Mon Nov 25 18:59:50 2013 -0500
+++ b/system-backend/src/main/java/com/redhat/thermostat/backend/system/JvmStatHostListener.java	Mon Nov 25 19:01:03 2013 -0500
@@ -54,6 +54,7 @@
 
 import com.redhat.thermostat.agent.VmBlacklist;
 import com.redhat.thermostat.agent.VmStatusListener.Status;
+import com.redhat.thermostat.agent.utils.ProcDataSource;
 import com.redhat.thermostat.backend.system.ProcessUserInfoBuilder.ProcessUserInfo;
 import com.redhat.thermostat.common.Pair;
 import com.redhat.thermostat.common.utils.LoggingUtils;
@@ -62,7 +63,6 @@
 import com.redhat.thermostat.storage.core.WriterID;
 import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.VmInfo;
-import com.redhat.thermostat.utils.ProcDataSource;
 
 public class JvmStatHostListener implements HostListener {
 
--- a/system-backend/src/main/java/com/redhat/thermostat/backend/system/ProcessEnvironmentBuilder.java	Mon Nov 25 18:59:50 2013 -0500
+++ b/system-backend/src/main/java/com/redhat/thermostat/backend/system/ProcessEnvironmentBuilder.java	Mon Nov 25 19:01:03 2013 -0500
@@ -46,8 +46,8 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import com.redhat.thermostat.agent.utils.ProcDataSource;
 import com.redhat.thermostat.common.utils.LoggingUtils;
-import com.redhat.thermostat.utils.ProcDataSource;
 
 public class ProcessEnvironmentBuilder {
 
--- a/system-backend/src/main/java/com/redhat/thermostat/backend/system/ProcessUserInfoBuilder.java	Mon Nov 25 18:59:50 2013 -0500
+++ b/system-backend/src/main/java/com/redhat/thermostat/backend/system/ProcessUserInfoBuilder.java	Mon Nov 25 19:01:03 2013 -0500
@@ -42,8 +42,8 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import com.redhat.thermostat.agent.utils.ProcDataSource;
 import com.redhat.thermostat.common.utils.LoggingUtils;
-import com.redhat.thermostat.utils.ProcDataSource;
 import com.redhat.thermostat.utils.username.UserNameLookupException;
 import com.redhat.thermostat.utils.username.UserNameUtil;
 
--- a/system-backend/src/main/java/com/redhat/thermostat/backend/system/SystemBackend.java	Mon Nov 25 18:59:50 2013 -0500
+++ b/system-backend/src/main/java/com/redhat/thermostat/backend/system/SystemBackend.java	Mon Nov 25 19:01:03 2013 -0500
@@ -47,6 +47,7 @@
 import sun.jvmstat.monitor.MonitoredHost;
 
 import com.redhat.thermostat.agent.VmBlacklist;
+import com.redhat.thermostat.agent.utils.ProcDataSource;
 import com.redhat.thermostat.backend.BaseBackend;
 import com.redhat.thermostat.common.Version;
 import com.redhat.thermostat.common.utils.LoggingUtils;
@@ -57,7 +58,6 @@
 import com.redhat.thermostat.storage.dao.VmInfoDAO;
 import com.redhat.thermostat.storage.model.HostInfo;
 import com.redhat.thermostat.storage.model.NetworkInterfaceInfo;
-import com.redhat.thermostat.utils.ProcDataSource;
 import com.redhat.thermostat.utils.username.UserNameUtil;
 
 public class SystemBackend extends BaseBackend {
--- a/system-backend/src/test/java/com/redhat/thermostat/backend/system/HostInfoBuilderTest.java	Mon Nov 25 18:59:50 2013 -0500
+++ b/system-backend/src/test/java/com/redhat/thermostat/backend/system/HostInfoBuilderTest.java	Mon Nov 25 19:01:03 2013 -0500
@@ -49,13 +49,13 @@
 import org.junit.Before;
 import org.junit.Test;
 
+import com.redhat.thermostat.agent.utils.ProcDataSource;
 import com.redhat.thermostat.backend.system.HostInfoBuilder.HostCpuInfo;
 import com.redhat.thermostat.backend.system.HostInfoBuilder.HostMemoryInfo;
 import com.redhat.thermostat.backend.system.HostInfoBuilder.HostOsInfo;
 import com.redhat.thermostat.common.Size;
 import com.redhat.thermostat.storage.core.WriterID;
 import com.redhat.thermostat.storage.model.HostInfo;
-import com.redhat.thermostat.utils.ProcDataSource;
 
 public class HostInfoBuilderTest {
 
--- a/system-backend/src/test/java/com/redhat/thermostat/backend/system/ProcessEnvironmentBuilderTest.java	Mon Nov 25 18:59:50 2013 -0500
+++ b/system-backend/src/test/java/com/redhat/thermostat/backend/system/ProcessEnvironmentBuilderTest.java	Mon Nov 25 19:01:03 2013 -0500
@@ -55,8 +55,8 @@
 
 import org.junit.Test;
 
+import com.redhat.thermostat.agent.utils.ProcDataSource;
 import com.redhat.thermostat.testutils.TestUtils;
-import com.redhat.thermostat.utils.ProcDataSource;
 
 public class ProcessEnvironmentBuilderTest {
 
--- a/system-backend/src/test/java/com/redhat/thermostat/backend/system/ProcessUserInfoBuilderTest.java	Mon Nov 25 18:59:50 2013 -0500
+++ b/system-backend/src/test/java/com/redhat/thermostat/backend/system/ProcessUserInfoBuilderTest.java	Mon Nov 25 19:01:03 2013 -0500
@@ -46,9 +46,9 @@
 
 import org.junit.Test;
 
+import com.redhat.thermostat.agent.utils.ProcDataSource;
 import com.redhat.thermostat.backend.system.ProcessUserInfoBuilder.ProcessUserInfo;
 import com.redhat.thermostat.common.tools.ApplicationException;
-import com.redhat.thermostat.utils.ProcDataSource;
 import com.redhat.thermostat.utils.username.UserNameLookupException;
 import com.redhat.thermostat.utils.username.UserNameUtil;
 
--- a/vm-cpu/agent/src/main/java/com/redhat/thermostat/vm/cpu/agent/internal/ProcessStatusInfoBuilder.java	Mon Nov 25 18:59:50 2013 -0500
+++ b/vm-cpu/agent/src/main/java/com/redhat/thermostat/vm/cpu/agent/internal/ProcessStatusInfoBuilder.java	Mon Nov 25 19:01:03 2013 -0500
@@ -43,8 +43,8 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import com.redhat.thermostat.agent.utils.ProcDataSource;
 import com.redhat.thermostat.common.utils.LoggingUtils;
-import com.redhat.thermostat.utils.ProcDataSource;
 
 /**
  * Extract status information about the process from /proc/. This is what tools
--- a/vm-cpu/agent/src/main/java/com/redhat/thermostat/vm/cpu/agent/internal/VmCpuBackend.java	Mon Nov 25 18:59:50 2013 -0500
+++ b/vm-cpu/agent/src/main/java/com/redhat/thermostat/vm/cpu/agent/internal/VmCpuBackend.java	Mon Nov 25 19:01:03 2013 -0500
@@ -48,14 +48,14 @@
 
 import com.redhat.thermostat.agent.VmStatusListener;
 import com.redhat.thermostat.agent.VmStatusListenerRegistrar;
+import com.redhat.thermostat.agent.utils.ProcDataSource;
+import com.redhat.thermostat.agent.utils.SysConf;
 import com.redhat.thermostat.backend.BaseBackend;
 import com.redhat.thermostat.common.Clock;
 import com.redhat.thermostat.common.SystemClock;
 import com.redhat.thermostat.common.Version;
 import com.redhat.thermostat.common.utils.LoggingUtils;
 import com.redhat.thermostat.storage.core.WriterID;
-import com.redhat.thermostat.utils.ProcDataSource;
-import com.redhat.thermostat.utils.SysConf;
 import com.redhat.thermostat.vm.cpu.common.VmCpuStatDAO;
 import com.redhat.thermostat.vm.cpu.common.model.VmCpuStat;
 
--- a/vm-cpu/agent/src/test/java/com/redhat/thermostat/vm/cpu/agent/internal/ProcessStatusInfoBuilderTest.java	Mon Nov 25 18:59:50 2013 -0500
+++ b/vm-cpu/agent/src/test/java/com/redhat/thermostat/vm/cpu/agent/internal/ProcessStatusInfoBuilderTest.java	Mon Nov 25 19:01:03 2013 -0500
@@ -48,7 +48,7 @@
 
 import org.junit.Test;
 
-import com.redhat.thermostat.utils.ProcDataSource;
+import com.redhat.thermostat.agent.utils.ProcDataSource;
 import com.redhat.thermostat.vm.cpu.agent.internal.ProcessStatusInfo;
 import com.redhat.thermostat.vm.cpu.agent.internal.ProcessStatusInfoBuilder;