# HG changeset patch # User Omair Majid # Date 1385424063 18000 # Node ID ad1f6b074c0c463855b7cbe02bca6697608daeea # Parent bfe13519288079e3bf07982178d13318cf469cee 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 diff -r bfe135192880 -r ad1f6b074c0c README.api --- 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 diff -r bfe135192880 -r ad1f6b074c0c agent/core/pom.xml --- 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 @@ 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, diff -r bfe135192880 -r ad1f6b074c0c agent/core/src/main/java/com/redhat/thermostat/agent/utils/ProcDataSource.java --- /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 + * . + * + * 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)); + } + +} + diff -r bfe135192880 -r ad1f6b074c0c agent/core/src/main/java/com/redhat/thermostat/agent/utils/SysConf.java --- /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 + * . + * + * 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. + *

+ * 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 + } + } + } + } +} + diff -r bfe135192880 -r ad1f6b074c0c agent/core/src/main/java/com/redhat/thermostat/utils/ProcDataSource.java --- 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 - * . - * - * 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)); - } - -} - diff -r bfe135192880 -r ad1f6b074c0c agent/core/src/main/java/com/redhat/thermostat/utils/SysConf.java --- 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 - * . - * - * 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. - *

- * 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 - } - } - } - } -} - diff -r bfe135192880 -r ad1f6b074c0c agent/core/src/test/java/com/redhat/thermostat/agent/utils/ProcDataSourceTest.java --- /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 + * . + * + * 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); + } + +} + diff -r bfe135192880 -r ad1f6b074c0c agent/core/src/test/java/com/redhat/thermostat/agent/utils/SysConfTest.java --- /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 + * . + * + * 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); + } +} + diff -r bfe135192880 -r ad1f6b074c0c agent/core/src/test/java/com/redhat/thermostat/utils/ProcDataSourceTest.java --- 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 - * . - * - * 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); - } - -} - diff -r bfe135192880 -r ad1f6b074c0c agent/core/src/test/java/com/redhat/thermostat/utils/SysConfTest.java --- 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 - * . - * - * 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); - } -} - diff -r bfe135192880 -r ad1f6b074c0c host-cpu/agent/src/main/java/com/redhat/thermostat/host/cpu/agent/internal/CpuStatBuilder.java --- 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 { diff -r bfe135192880 -r ad1f6b074c0c host-cpu/agent/src/main/java/com/redhat/thermostat/host/cpu/agent/internal/HostCpuBackend.java --- 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 { diff -r bfe135192880 -r ad1f6b074c0c host-cpu/agent/src/test/java/com/redhat/thermostat/host/cpu/agent/internal/CpuStatBuilderTest.java --- 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 { diff -r bfe135192880 -r ad1f6b074c0c host-memory/agent/src/main/java/com/redhat/thermostat/host/memory/agent/internal/HostMemoryBackend.java --- 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 { diff -r bfe135192880 -r ad1f6b074c0c host-memory/agent/src/main/java/com/redhat/thermostat/host/memory/agent/internal/MemoryStatBuilder.java --- 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/ diff -r bfe135192880 -r ad1f6b074c0c host-memory/agent/src/test/java/com/redhat/thermostat/host/memory/agent/internal/MemoryStatBuilderTest.java --- 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 { diff -r bfe135192880 -r ad1f6b074c0c system-backend/src/main/java/com/redhat/thermostat/backend/system/HostInfoBuilder.java --- 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 { diff -r bfe135192880 -r ad1f6b074c0c system-backend/src/main/java/com/redhat/thermostat/backend/system/JvmStatHostListener.java --- 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 { diff -r bfe135192880 -r ad1f6b074c0c system-backend/src/main/java/com/redhat/thermostat/backend/system/ProcessEnvironmentBuilder.java --- 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 { diff -r bfe135192880 -r ad1f6b074c0c system-backend/src/main/java/com/redhat/thermostat/backend/system/ProcessUserInfoBuilder.java --- 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; diff -r bfe135192880 -r ad1f6b074c0c system-backend/src/main/java/com/redhat/thermostat/backend/system/SystemBackend.java --- 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 { diff -r bfe135192880 -r ad1f6b074c0c system-backend/src/test/java/com/redhat/thermostat/backend/system/HostInfoBuilderTest.java --- 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 { diff -r bfe135192880 -r ad1f6b074c0c system-backend/src/test/java/com/redhat/thermostat/backend/system/ProcessEnvironmentBuilderTest.java --- 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 { diff -r bfe135192880 -r ad1f6b074c0c system-backend/src/test/java/com/redhat/thermostat/backend/system/ProcessUserInfoBuilderTest.java --- 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; diff -r bfe135192880 -r ad1f6b074c0c vm-cpu/agent/src/main/java/com/redhat/thermostat/vm/cpu/agent/internal/ProcessStatusInfoBuilder.java --- 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 diff -r bfe135192880 -r ad1f6b074c0c vm-cpu/agent/src/main/java/com/redhat/thermostat/vm/cpu/agent/internal/VmCpuBackend.java --- 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; diff -r bfe135192880 -r ad1f6b074c0c vm-cpu/agent/src/test/java/com/redhat/thermostat/vm/cpu/agent/internal/ProcessStatusInfoBuilderTest.java --- 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;