Examples of took()


Examples of org.elasticsearch.action.search.SearchResponse.took()

        System.out.println("--> Running just child query");
        // run just the child query, warm up first
        for (int j = 0; j < QUERY_WARMUP; j++) {
            SearchResponse searchResponse = client.prepareSearch().setQuery(termQuery("child.tag", "tag1")).execute().actionGet();
            if (j == 0) {
                System.out.println("--> Warmup took: " + searchResponse.took());
            }
            if (searchResponse.hits().totalHits() != COUNT) {
                System.err.println("--> mismatch on hits");
            }
        }
View Full Code Here

Examples of org.elasticsearch.action.search.SearchResponse.took()

                    .setQuery(matchAllQuery())
                    .addFacet(histogramFacet("l_value").field("l_value").interval(4))
                    .addFacet(histogramFacet("date").field("date").interval(1000))
                    .execute().actionGet();
            if (j == 0) {
                System.out.println("--> Warmup took: " + searchResponse.took());
            }
            if (searchResponse.hits().totalHits() != COUNT) {
                System.err.println("--> mismatch on hits");
            }
        }
View Full Code Here

Examples of org.elasticsearch.action.search.SearchResponse.took()

                    .setSearchType(SearchType.COUNT)
                    .setQuery(matchAllQuery())
                    .addFacet(termsFacet(field).field(field).executionHint(executionHint))
                    .execute().actionGet();
            if (j == 0) {
                System.out.println("--> Loading (" + field + "): took: " + searchResponse.took());
            }
            if (searchResponse.hits().totalHits() != COUNT) {
                System.err.println("--> mismatch on hits");
            }
        }
View Full Code Here

Examples of org.elasticsearch.action.search.SearchResponse.took()

                    .setSearchType(SearchType.COUNT)
                    .setQuery(matchAllQuery())
                    .addFacet(termsStatsFacet(name).keyField(keyField).valueField(valueField))
                    .execute().actionGet();
            if (j == 0) {
                System.out.println("--> Loading (" + name + "): took: " + searchResponse.took());
            }
            if (searchResponse.hits().totalHits() != COUNT) {
                System.err.println("--> mismatch on hits");
            }
        }
View Full Code Here

Examples of org.graylog2.indexer.results.HistogramResult.took()

                    Searches.DateHistogramInterval.valueOf(((String) config.get("interval")).toUpperCase()),
                    filter,
                    timeRange
            );

            return new ComputationResult(histogramResult.getResults(), histogramResult.took().millis(), histogramResult.getHistogramBoundaries());
        } catch (Searches.FieldTypeException e) {
            String msg = "Could not calculate [" + this.getClass().getCanonicalName() + "] widget <" + getId() + ">. Not a numeric field? The field was [" + config.get("field") + "]";
            LOG.error(msg, e);
            throw new RuntimeException(msg);
        } catch (IndexHelper.InvalidRangeFormatException e) {
View Full Code Here

Examples of org.graylog2.indexer.results.HistogramResult.took()

            filter = "streams:" + streamId;
        }

        try {
            HistogramResult histogram = searches.histogram(query, interval, filter, timeRange);
            return new ComputationResult(histogram.getResults(), histogram.took().millis(), histogram.getHistogramBoundaries());
        } catch (IndexHelper.InvalidRangeFormatException e) {
            throw new RuntimeException("Invalid timerange format.", e);
        }
    }
}
View Full Code Here

Examples of org.graylog2.indexer.results.TermsResult.took()

        }

        Map<String, Object> result = Maps.newHashMap();
        result.put("total", sources.getTerms().size());
        result.put("sources", sources.getTerms());
        result.put("took_ms", sources.took().millis());
        result.put("range", range);

        return json(result);
    }
View Full Code Here

Examples of org.graylog2.indexer.results.TermsResult.took()

            result.put("terms", terms.getTerms());
            result.put("total", terms.getTotal());
            result.put("other", terms.getOther());
            result.put("missing", terms.getMissing());

            return new ComputationResult(result, terms.took().millis());
        } catch (IndexHelper.InvalidRangeFormatException e) {
            String msg = "Could not calculate [" + this.getClass().getCanonicalName() + "] widget <" + getId() + ">. Invalid time range.";
            LOG.error(msg, e);
            throw new RuntimeException(msg);
        }
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.