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

Method markCompleteTimeout

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

Source from the content-addressed store, hash-verified

225 }
226
227 @Test
228 public void markCompleteTimeout() throws Exception {
229 final TSQuery query = new TSQuery();
230 query.setStart("1h-ago");
231 final QueryStats stats = new QueryStats(remote, query, headers);
232 final RuntimeException timeout = new RuntimeException("Timeout!");
233 stats.markSerialized(HttpResponseStatus.REQUEST_TIMEOUT, timeout);
234 final Map<String, Object> map = QueryStats.getRunningAndCompleteStats();
235 assertNotNull(map);
236 assertEquals(0, ((List<Object>)map.get("running")).size());
237 assertEquals(1, ((Collection<QueryStats>)map.get("completed")).size());
238 final QueryStats completed = ((Collection<QueryStats>)map.get("completed"))
239 .iterator().next();
240 assertEquals(408, completed.getHttpResponse().getCode());
241 assertTrue(completed.getException().startsWith("Timeout!\n"));
242 }
243
244 @Test
245 public void executed() throws Exception {

Callers

nothing calls this directly

Calls 9

setStartMethod · 0.95
markSerializedMethod · 0.95
getHttpResponseMethod · 0.95
getExceptionMethod · 0.95
sizeMethod · 0.65
nextMethod · 0.65
iteratorMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected