Package com.datastax.driver.core

Examples of com.datastax.driver.core.QueryTrace


        for (ExecutionInfo executionInfo : resultSet.getAllExecutionInfo()) {
            if (executionInfo == null)
                continue;
            Host qh = executionInfo.getQueriedHost();
            ConsistencyLevel cl = executionInfo.getAchievedConsistencyLevel();
            QueryTrace queryTrace = executionInfo.getQueryTrace();
            execInfo.append("\n    exeuction info: queried-host=[address=").append(qh.getAddress()).
                append(", version=").append(qh.getCassandraVersion()).
                append(", dc=").append(qh.getDatacenter()).
                append(", rac=").append(qh.getRack()).
                append("], achieved-consistency-level=").append(cl);
            if (queryTrace != null) {
                InetAddress coordinator = queryTrace.getCoordinator();
                int durationMicros = queryTrace.getDurationMicros();
                Map<String, String> parameters = queryTrace.getParameters();
                String requestType = queryTrace.getRequestType();
                long startedAt = queryTrace.getStartedAt();
                UUID traceId = queryTrace.getTraceId();
                execInfo.append("\n        query-trace: coordinator=").append(coordinator).
                    append(", duration[us]=").append(durationMicros).
                    append(", requestType=").append(requestType).
                    append(", startedAt=").append(startedAt).
                    append(", traceId=").append(traceId).
                    append(", parameters=").append(parameters);
                if (fetchTrace) {
                    List<QueryTrace.Event> events = queryTrace.getEvents();
                    if (events != null) {
                        for (QueryTrace.Event event : events) {
                            if (event == null)
                                continue;
                            InetAddress source = event.getSource();
View Full Code Here


                actualLogger.trace("****************************");
                if (actualLogger.isTraceEnabled()) {
                    actualLogger.trace(String.format("%1$-80s | %2$-16s | %3$-24s | %4$-20s", "Description", "Source", "Source elapsed in micros", "Thread name"));
                }
                try {
                    final QueryTrace queryTrace = executionInfo.getQueryTrace();
                    final List<QueryTrace.Event> events = new ArrayList<>(queryTrace.getEvents());
                    Collections.sort(events, EVENT_TRACE_COMPARATOR);
                    for (QueryTrace.Event event : events) {
                        final String formatted = String.format("%1$-80s | %2$-16s | %3$-24s | %4$-20s", event.getDescription(), event.getSource(), event.getSourceElapsedMicros(), event.getThreadName());
                        actualLogger.trace(formatted);
                    }
View Full Code Here

 
  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();
        }
      }
    }
    return 0L;
  }
View Full Code Here

TOP

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

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.