From ed5498ed1220c44dcc41626dc9778e96529254f4 Mon Sep 17 00:00:00 2001
From: Hendrik Muhs <hendrik.muhs@elastic.co>
Date: Fri, 20 Nov 2020 15:06:39 +0100
Subject: [PATCH] [Transform] add more debug logging in testUsage IT (#65296)

log the full usage response on failure (individual counts are logged already)

relates #52931
---
 .../xpack/transform/integration/TransformUsageIT.java         | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformUsageIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformUsageIT.java
index f8efe1d581c4d..bd4a542162b10 100644
--- a/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformUsageIT.java
+++ b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformUsageIT.java
@@ -110,13 +110,13 @@ public void testUsage() throws Exception {
                 // the trigger count can be higher if the scheduler kicked before usage has been called, therefore check for gte
                 if (statName.equals(TransformIndexerStats.NUM_INVOCATIONS.getPreferredName())) {
                     assertThat(
-                        "Incorrect stat " + statName,
+                        "Incorrect stat " + statName + ", got: " + statsMap.get("transform"),
                         extractStatsAsDouble(XContentMapValues.extractValue("transform.stats." + statName, statsMap)),
                         greaterThanOrEqualTo(expectedStats.get(statName).doubleValue())
                     );
                 } else {
                     assertThat(
-                        "Incorrect stat " + statName,
+                        "Incorrect stat " + statName + ", got: " + statsMap.get("transform"),
                         extractStatsAsDouble(XContentMapValues.extractValue("transform.stats." + statName, statsMap)),
                         equalTo(expectedStats.get(statName).doubleValue())
                     );