MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / executedTwice

Method executedTwice

test/stats/TestQueryStats.java:259–282  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

257 }
258
259 @Test
260 public void executedTwice() throws Exception {
261 final TSQuery query = new TSQuery();
262 query.setStart("1h-ago");
263 QueryStats stats = new QueryStats(remote, query, headers);
264 stats.markSerialized(HttpResponseStatus.REQUEST_TIMEOUT, null);
265 Map<String, Object> map = QueryStats.getRunningAndCompleteStats();
266 assertNotNull(map);
267 assertEquals(0, ((List<Object>)map.get("running")).size());
268 assertEquals(1, ((Collection<QueryStats>)map.get("completed")).size());
269 QueryStats completed = ((Collection<QueryStats>)map.get("completed"))
270 .iterator().next();
271 assertEquals(1, completed.getExecuted());
272
273 stats = new QueryStats(remote, query, headers);
274 stats.markSerialized(HttpResponseStatus.REQUEST_TIMEOUT, null);
275 map = QueryStats.getRunningAndCompleteStats();
276 assertNotNull(map);
277 assertEquals(0, ((List<Object>)map.get("running")).size());
278 assertEquals(1, ((Collection<QueryStats>)map.get("completed")).size());
279 completed = ((Collection<QueryStats>)map.get("completed"))
280 .iterator().next();
281 assertEquals(2, completed.getExecuted());
282 }
283
284 @Test
285 public void getStat() throws Exception {

Callers

nothing calls this directly

Calls 8

setStartMethod · 0.95
markSerializedMethod · 0.95
getExecutedMethod · 0.95
sizeMethod · 0.65
nextMethod · 0.65
iteratorMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected