Mercurial > hg > release > thermostat-0.6
changeset 964:e11acc79c432
Adjust NUMA Ordering
Currently the order value for the NUMA Backend is set to ORDER_CPU_GROUP
and the NUMA InformationService is set to ORDER_MEMORY_GROUP. Since NUMA
deals with memory I have changed the Backend to use ORDER_MEMORY_GROUP.
Also in order to avoid conflict with other plug-ins, the order value
used should have an offset that is different from other plug-ins we
ship. I neglected to mention this in the javadoc before. Since NUMA is
not relevant to all users, I have added it after the other
memory-related views/backends (with offset 80).
Reviewed-by: rkennke
Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2013-January/005480.html
author | Elliott Baron <ebaron@redhat.com> |
---|---|
date | Mon, 11 Feb 2013 16:19:03 -0500 |
parents | df6e0f7f8540 |
children | f6bc84590701 |
files | common/core/src/main/java/com/redhat/thermostat/common/Ordered.java numa/agent/src/main/java/com/redhat/thermostat/numa/agent/internal/NumaBackend.java numa/agent/src/test/java/com/redhat/thermostat/numa/agent/internal/NumaBackendTest.java numa/client-core/src/main/java/com/redhat/thermostat/numa/client/core/internal/NumaInformationServiceImpl.java numa/client-core/src/test/java/com/redhat/thermostat/numa/client/core/NumaInformationServiceTest.java |
diffstat | 5 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/common/core/src/main/java/com/redhat/thermostat/common/Ordered.java Fri Feb 08 19:10:32 2013 +0100 +++ b/common/core/src/main/java/com/redhat/thermostat/common/Ordered.java Mon Feb 11 16:19:03 2013 -0500 @@ -83,6 +83,8 @@ * services. A service with a lower order value will * be processed before a service of a higher order value. This * ordering is used, for example, to sort views in a client's UI. + * Please take care to ensure the value returned by this + * implementation does not collide with other implementations. * * The order value should be offset from one of the provided * constants in this class. Such as {@link #ORDER_DEFAULT_GROUP}.
--- a/numa/agent/src/main/java/com/redhat/thermostat/numa/agent/internal/NumaBackend.java Fri Feb 08 19:10:32 2013 +0100 +++ b/numa/agent/src/main/java/com/redhat/thermostat/numa/agent/internal/NumaBackend.java Mon Feb 11 16:19:03 2013 -0500 @@ -129,7 +129,7 @@ @Override public int getOrderValue() { - return ORDER_CPU_GROUP; + return ORDER_MEMORY_GROUP + 80; } }
--- a/numa/agent/src/test/java/com/redhat/thermostat/numa/agent/internal/NumaBackendTest.java Fri Feb 08 19:10:32 2013 +0100 +++ b/numa/agent/src/test/java/com/redhat/thermostat/numa/agent/internal/NumaBackendTest.java Mon Feb 11 16:19:03 2013 -0500 @@ -46,7 +46,6 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; -import static org.mockito.Mockito.verifyZeroInteractions; import static org.mockito.Mockito.when; import java.io.IOException; @@ -168,7 +167,7 @@ @Test public void testOrderValue() { - assertEquals(Ordered.ORDER_CPU_GROUP, backend.getOrderValue()); + assertEquals(Ordered.ORDER_MEMORY_GROUP + 80, backend.getOrderValue()); } }
--- a/numa/client-core/src/main/java/com/redhat/thermostat/numa/client/core/internal/NumaInformationServiceImpl.java Fri Feb 08 19:10:32 2013 +0100 +++ b/numa/client-core/src/main/java/com/redhat/thermostat/numa/client/core/internal/NumaInformationServiceImpl.java Mon Feb 11 16:19:03 2013 -0500 @@ -47,7 +47,7 @@ public class NumaInformationServiceImpl implements NumaInformationService { - private static final int ORDER = ORDER_MEMORY_GROUP; + private static final int ORDER = ORDER_MEMORY_GROUP + 80; private static final Filter<HostRef> FILTER = new NameMatchingRefFilter<>(); private ApplicationService appSvc;
--- a/numa/client-core/src/test/java/com/redhat/thermostat/numa/client/core/NumaInformationServiceTest.java Fri Feb 08 19:10:32 2013 +0100 +++ b/numa/client-core/src/test/java/com/redhat/thermostat/numa/client/core/NumaInformationServiceTest.java Mon Feb 11 16:19:03 2013 -0500 @@ -68,7 +68,7 @@ NumaInformationServiceImpl numaInfoService = new NumaInformationServiceImpl(appSvc, numaDAO, numaViewProvider); int order = numaInfoService.getOrderValue(); - assertEquals(Ordered.ORDER_MEMORY_GROUP, order); + assertEquals(Ordered.ORDER_MEMORY_GROUP + 80, order); HostRef ref = mock(HostRef.class); assertTrue(numaInfoService.getInformationServiceController(ref) instanceof NumaController); assertNotNull(numaInfoService.getFilter());