From 296c940b7c9ccbc310fe6299d39dd6188c7b87ea Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Wed, 15 Mar 2023 16:58:06 -0400 Subject: [PATCH] minor cleanup Signed-off-by: Andrew Azores --- src/main/java/io/cryostat/net/AgentClient.java | 10 ++++------ src/main/java/io/cryostat/net/AgentConnection.java | 4 +--- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main/java/io/cryostat/net/AgentClient.java b/src/main/java/io/cryostat/net/AgentClient.java index f1483f7b1c..69f446820b 100644 --- a/src/main/java/io/cryostat/net/AgentClient.java +++ b/src/main/java/io/cryostat/net/AgentClient.java @@ -99,11 +99,9 @@ Future mbeanMetrics() { Future> f = invoke(HttpMethod.GET, "/mbean-metrics", BodyCodec.string()); return f.map(HttpResponse::body) - .map( - s -> { - logger.info("mbean response: {}", s); - return gson.fromJson(s, MBeanMetrics.class); - }); + // uses Gson rather than Vertx's Jackson because Gson is able to handle MBeanMetrics + // with no additional fuss. Jackson complains about private final fields. + .map(s -> gson.fromJson(s, MBeanMetrics.class)); } private Future> invoke(HttpMethod mtd, String path, BodyCodec codec) { @@ -143,7 +141,7 @@ private Future> invoke(HttpMethod mtd, String path, BodyCode promise.fail(ar.cause()); return; } - logger.info( + logger.trace( "{} {}{} status {}: {}", mtd, agentUri, diff --git a/src/main/java/io/cryostat/net/AgentConnection.java b/src/main/java/io/cryostat/net/AgentConnection.java index 85a465244d..86e47ea614 100644 --- a/src/main/java/io/cryostat/net/AgentConnection.java +++ b/src/main/java/io/cryostat/net/AgentConnection.java @@ -184,9 +184,7 @@ public MBeanMetrics getMBeanMetrics() throws ConnectionException, IOException, InstanceNotFoundException, IntrospectionException, ReflectionException { try { - var m = client.mbeanMetrics().toCompletionStage().toCompletableFuture().get(); - logger.info("mbeans: {}", m); - return m; + return client.mbeanMetrics().toCompletionStage().toCompletableFuture().get(); } catch (ExecutionException | InterruptedException e) { throw new IOException(e); }