Mercurial > hg > thermostat-ng > agent
changeset 2682:921513fbfa70
Temporarily prevent TLAB stats from being output
Reviewed-by: ebaron
Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-June/023474.html
author | Jie Kang <jkang@redhat.com> |
---|---|
date | Mon, 05 Jun 2017 11:54:07 -0400 |
parents | 1f8eb72c6f54 |
children | 7314953c7d86 |
files | plugins/vm-memory/common/src/main/java/com/redhat/thermostat/vm/memory/common/internal/VmTlabStatDAOImpl.java plugins/vm-memory/common/src/test/java/com/redhat/thermostat/vm/memory/common/internal/VmTlabStatDAOTest.java |
diffstat | 2 files changed, 19 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/vm-memory/common/src/main/java/com/redhat/thermostat/vm/memory/common/internal/VmTlabStatDAOImpl.java Mon Jun 05 09:12:56 2017 -0400 +++ b/plugins/vm-memory/common/src/main/java/com/redhat/thermostat/vm/memory/common/internal/VmTlabStatDAOImpl.java Mon Jun 05 11:54:07 2017 -0400 @@ -82,17 +82,20 @@ @Override public void putStat(final VmTlabStat stat) { - try { - String json = jsonHelper.toJson(Arrays.asList(stat)); - StringContentProvider provider = httpHelper.createContentProvider(json); - - Request httpRequest = client.newRequest(gatewayURL); - httpRequest.method(HttpMethod.POST); - httpRequest.content(provider, CONTENT_TYPE); - sendRequest(httpRequest); - } catch (Exception e) { - logger.log(Level.WARNING, "Failed to send VmTlabStat to Web Gateway", e); - } +// TODO: Re-enable when web-gateway service for TLAB stats is available +// Also see VmTlabStatDAOTest for disabled tests + return; +// try { +// String json = jsonHelper.toJson(Arrays.asList(stat)); +// StringContentProvider provider = httpHelper.createContentProvider(json); +// +// Request httpRequest = client.newRequest(gatewayURL); +// httpRequest.method(HttpMethod.POST); +// httpRequest.content(provider, CONTENT_TYPE); +// sendRequest(httpRequest); +// } catch (Exception e) { +// logger.log(Level.WARNING, "Failed to send VmTlabStat to Web Gateway", e); +// } } private void sendRequest(Request httpRequest)
--- a/plugins/vm-memory/common/src/test/java/com/redhat/thermostat/vm/memory/common/internal/VmTlabStatDAOTest.java Mon Jun 05 09:12:56 2017 -0400 +++ b/plugins/vm-memory/common/src/test/java/com/redhat/thermostat/vm/memory/common/internal/VmTlabStatDAOTest.java Mon Jun 05 11:54:07 2017 -0400 @@ -45,6 +45,7 @@ import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.http.HttpStatus; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import java.util.Arrays; @@ -94,7 +95,11 @@ } @Test + @Ignore public void verifyPutStat() throws Exception { +// TODO: Remove @Ignore when web-gateway service for TLAB stats is available +// See VmTlabStatDAOImpl.putStat() + VmTlabStat stat = new VmTlabStat(); stat.setAgentId(AGENT_ID); stat.setVmId(VM_ID);