Package org.elasticsearch.action.admin.cluster.node.hotthreads

Examples of org.elasticsearch.action.admin.cluster.node.hotthreads.NodesHotThreadsRequestBuilder


    }

    private <T> List<T> runQueries(final List<? extends Callable<T>> tasks, final String testName) throws Exception {
        clearMemory();
        final ListenableActionFuture<NodesHotThreadsResponse> threads = _hotThreads ?
                new NodesHotThreadsRequestBuilder(client().admin().cluster())
                        .setInterval(TimeValue.timeValueSeconds(3))
                        .setType("cpu").setThreads(4).execute()
                : null;
        logExecutionStart(testName);
        final List<Future<T>> futures = threadPool().invokeAll(tasks);
View Full Code Here


        execute(NodesHotThreadsAction.INSTANCE, request, listener);
    }

    @Override
    public NodesHotThreadsRequestBuilder prepareNodesHotThreads(String... nodesIds) {
        return new NodesHotThreadsRequestBuilder(this).setNodesIds(nodesIds);
    }
View Full Code Here

        createIndex("test");
        final int iters = scaledRandomIntBetween(2, 20);
        final AtomicBoolean hasErrors = new AtomicBoolean(false);
        for (int i = 0; i < iters; i++) {
            final String type;
            NodesHotThreadsRequestBuilder nodesHotThreadsRequestBuilder = client().admin().cluster().prepareNodesHotThreads();
            if (randomBoolean()) {
                TimeValue timeValue = new TimeValue(rarely() ? randomIntBetween(500, 5000) : randomIntBetween(20, 500));
                nodesHotThreadsRequestBuilder.setInterval(timeValue);
            }
            if (randomBoolean()) {
                nodesHotThreadsRequestBuilder.setThreads(rarely() ? randomIntBetween(500, 5000) : randomIntBetween(1, 500));
            }
            if (randomBoolean()) {
                switch (randomIntBetween(0, 2)) {
                    case 2:
                        type = "cpu";
                        break;
                    case 1:
                        type = "wait";
                        break;
                    default:
                        type = "block";
                        break;
                }
                assertThat(type, notNullValue());
                nodesHotThreadsRequestBuilder.setType(type);
            } else {
                type = null;
            }
            final CountDownLatch latch = new CountDownLatch(1);
            nodesHotThreadsRequestBuilder.execute(new ActionListener<NodesHotThreadsResponse>() {
                @Override
                public void onResponse(NodesHotThreadsResponse nodeHotThreads) {
                    boolean success = false;
                    try {
                        assertThat(nodeHotThreads, notNullValue());
View Full Code Here

TOP

Related Classes of org.elasticsearch.action.admin.cluster.node.hotthreads.NodesHotThreadsRequestBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.