Package com.datastax.driver.core

Examples of com.datastax.driver.core.ExecutionInfo


    public void should_trace_query() throws Exception {
        //Given
        wrapper = new RegularStatementWrapper(Entity1.class, rs, new Object[] { 1 }, ONE, NO_LISTENER, NO_SERIAL_CONSISTENCY);
        wrapper.traceQueryForEntity = true;

        ExecutionInfo executionInfo = mock(ExecutionInfo.class, RETURNS_DEEP_STUBS);

        QueryTrace.Event event = mock(QueryTrace.Event.class);
        when(resultSet.getAllExecutionInfo()).thenReturn(asList(executionInfo));
        when(executionInfo.getAchievedConsistencyLevel()).thenReturn(ConsistencyLevel.ALL);
        when(executionInfo.getQueryTrace().getEvents()).thenReturn(asList(event));
        when(event.getDescription()).thenReturn("description");
        when(event.getSource()).thenReturn(InetAddress.getLocalHost());
        when(event.getSourceElapsedMicros()).thenReturn(100);
        when(event.getThreadName()).thenReturn("thread");
View Full Code Here


    return toHost;
  }
 
  private long parseDuration(ResultSet rs) {
    if (rs != null) {
      ExecutionInfo info = rs.getExecutionInfo();
      if (info !=null) {
        QueryTrace qt = info.getQueryTrace();
        if (qt != null) {
          return qt.getDurationMicros();
        }
      }
    }
View Full Code Here

TOP

Related Classes of com.datastax.driver.core.ExecutionInfo

Copyright © 2018 www.massapicom. 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.