Package org.elasticsearch.common

Examples of org.elasticsearch.common.StopWatch.stop()


                transportService.submitRequest(request.targetNode(), RecoveryTarget.Actions.PREPARE_TRANSLOG, new RecoveryPrepareForTranslogOperationsRequest(request.shardId()), VoidTransportResponseHandler.INSTANCE_SAME).txGet();

                int totalOperations = sendSnapshot(snapshot);

                stopWatch.stop();
                logger.trace("[{}][{}] recovery [phase2] to {}: took [{}]", request.shardId().index().name(), request.shardId().id(), request.targetNode(), stopWatch.totalTime());
                response.phase2Time = stopWatch.totalTime().millis();
                response.phase2Operations = totalOperations;
            }
View Full Code Here


                        // we can ignore this exception since, on the other node, when it moved to phase3
                        // it will also send shard started, which might cause the index shard we work against
                        // to move be closed by the time we get to the the relocated method
                    }
                }
                stopWatch.stop();
                logger.trace("[{}][{}] recovery [phase3] to {}: took [{}]", request.shardId().index().name(), request.shardId().id(), request.targetNode(), stopWatch.totalTime());
                response.phase3Time = stopWatch.totalTime().millis();
                response.phase3Operations = totalOperations;
            }
View Full Code Here

        StopWatch stopWatch = new StopWatch().start();
        for (long i = 0; i < ITER; i++) {
            se.execute(compiled, vars);
        }
        System.out.println("Execute Took: " + stopWatch.stop().lastTaskTime());

        stopWatch = new StopWatch().start();
        ExecutableScript executableScript = se.executable(compiled, vars);
        for (long i = 0; i < ITER; i++) {
            executableScript.run();
View Full Code Here

        stopWatch = new StopWatch().start();
        ExecutableScript executableScript = se.executable(compiled, vars);
        for (long i = 0; i < ITER; i++) {
            executableScript.run();
        }
        System.out.println("Executable Took: " + stopWatch.stop().lastTaskTime());

        stopWatch = new StopWatch().start();
        executableScript = se.executable(compiled, vars);
        for (long i = 0; i < ITER; i++) {
            for (Map.Entry<String, Object> entry : vars.entrySet()) {
View Full Code Here

            for (Map.Entry<String, Object> entry : vars.entrySet()) {
                executableScript.setNextVar(entry.getKey(), entry.getValue());
            }
            executableScript.run();
        }
        System.out.println("Executable (vars) Took: " + stopWatch.stop().lastTaskTime());
    }
}
View Full Code Here

                break;

            MySearchHits res = callback(rsp.hits());
            if (res == null)
                break;
            queryWatch.stop();
            StopWatch updateWatch = new StopWatch().start();
            failed += bulkUpdate(res, newIndex, newType, withVersion).size();
            if (flushEnabled)
                client.admin().indices().flush(new FlushRequest(newIndex)).actionGet();
View Full Code Here

            StopWatch updateWatch = new StopWatch().start();
            failed += bulkUpdate(res, newIndex, newType, withVersion).size();
            if (flushEnabled)
                client.admin().indices().flush(new FlushRequest(newIndex)).actionGet();

            updateWatch.stop();
            collectedResults += currentResults;
            logger.debug("Progress " + collectedResults + "/" + total
                    + ". Time of update:" + updateWatch.totalTime().getSeconds() + " query:"
                    + queryWatch.totalTime().getSeconds() + " failed:" + failed);
        }
View Full Code Here

            tweets = createReal();

        logger.info("Now feeding");
        StopWatch sw = new StopWatch().start();
        tws.bulkUpdate(tweets, tws.getIndexName());
        long time = sw.stop().totalTime().seconds();
        if (time == 0)
            time = 1;
        logger.info("Feeded " + tweets.size() + " users => " + tweets.size() / time + " users/sec");
    }
View Full Code Here

                            setScroll(TimeValue.timeValueMinutes(keepTime)).execute().actionGet();
                    long currentResults = rsp.hits().hits().length;
                    if (currentResults == 0)
                        break;

                    queryWatch.stop();
                    Collection<T> objs = createObj.collectObjects(rsp);
                    StopWatch updateWatch = new StopWatch().start();
                    int failed = bulkUpdate(objs, intoIndex, false, false).size();
                    // trying to enable flushing to avoid memory issues on the server side?
                    flush(intoIndex);
View Full Code Here

                    Collection<T> objs = createObj.collectObjects(rsp);
                    StopWatch updateWatch = new StopWatch().start();
                    int failed = bulkUpdate(objs, intoIndex, false, false).size();
                    // trying to enable flushing to avoid memory issues on the server side?
                    flush(intoIndex);
                    updateWatch.stop();
                    collectedResults += currentResults;
                    logger.info("Progress " + collectedResults + "/" + total + " fromIndex="
                            + fromIndex + " update:" + updateWatch.totalTime().getSeconds() + " query:" + queryWatch.totalTime().getSeconds() + " failed:" + failed);
                }
                logger.info("Finished copying of index:" + fromIndex + ". Total:" + total + " collected:" + collectedResults);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.