use of io.crate.monitor.ExtendedOsStats in project crate by crate.
the class NodeOsExpressionTest method testOsTimestampNotEvaluatedTwice.
@Test
public void testOsTimestampNotEvaluatedTwice() throws Exception {
ExtendedOsStats osStats = mock(ExtendedOsStats.class);
NodeOsExpression nodeOsExpression = new NodeOsExpression(osStats);
ReferenceImplementation timestampExpr = nodeOsExpression.getChildImplementation("timestamp");
Long ts1 = (Long) timestampExpr.value();
Thread.sleep(10L);
Long ts2 = (Long) timestampExpr.value();
assertEquals(ts1, ts2);
}
Aggregations