Test: switch to TRACE logging for some components

This commit is contained in:
Michael McCandless 2014-11-10 16:27:34 -05:00 committed by mikemccand
parent 59117125b4
commit 91bef2e40f
1 changed files with 47 additions and 38 deletions

View File

@ -36,6 +36,7 @@ import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.io.stream.BytesStreamInput;
import org.elasticsearch.common.io.stream.BytesStreamOutput;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.settings.ImmutableSettings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.merge.policy.TieredMergePolicyProvider;
@ -330,6 +331,12 @@ public class IndexStatsTests extends ElasticsearchIntegrationTest {
@Test
public void throttleStats() throws Exception {
Loggers.getLogger("lucene.iw").setLevel("TRACE");
Loggers.getLogger("index.merge.scheduler").setLevel("TRACE");
Loggers.getLogger("index.shard.service").setLevel("TRACE");
Loggers.getLogger("test.engine").setLevel("TRACE");
try {
assertAcked(prepareCreate("test")
.setSettings(ImmutableSettings.builder()
.put(AbstractIndexStore.INDEX_STORE_THROTTLE_TYPE, "merge")
@ -366,12 +373,14 @@ public class IndexStatsTests extends ElasticsearchIntegrationTest {
//nodesStats = client().admin().cluster().prepareNodesStats().setIndices(true).get();
done = stats.getPrimaries().getIndexing().getTotal().getThrottleTimeInMillis() > 0;
if (System.currentTimeMillis() - start > 300*1000) { //Wait 5 minutes for throttling to kick in
break;
fail("index throttling didn't kick in after 5 minutes of intense merging");
}
}
stats = client().admin().indices().prepareStats().execute().actionGet();
if (done) {
assertThat(stats.getPrimaries().getIndexing().getTotal().getThrottleTimeInMillis(), greaterThan(0l));
} finally {
Loggers.getLogger("lucene.iw").setLevel("DEBUG");
Loggers.getLogger("index.merge.scheduler").setLevel("DEBUG");
Loggers.getLogger("index.shard.service").setLevel("DEBUG");
Loggers.getLogger("test.engine").setLevel("DEBUG");
}
}