Package com.yammer.metrics.core

Examples of com.yammer.metrics.core.TimerContext.stop()


                                    .class).time();
                            try {
                                //--- first we do the transformation
                                xsltResponse = Xml.transform(rootElem, styleSheet);
                            } finally {
                                timerContext.stop();
                            }
                            req.beginStream("application/json; charset=UTF-8", cache);
                            req.getOutputStream().write(Xml.getJSON(xsltResponse).getBytes(Constants.ENCODING));
                            req.endStream();
                        } else {
View Full Code Here


                                    .class).time();
                            try {
                                //--- first we do the transformation
                                Xml.transform(rootElem, styleSheet, baos);
                            } finally {
                                timerContext.stop();
                            }
                            req.beginStream(outPage.getContentType(), cache);
                            req.getOutputStream().write(baos.toByteArray());
                            req.endStream();
                        }
View Full Code Here

      return preparedStatementCache.get(cql.getQuery());
    } else {
      Long currentTime = System.currentTimeMillis();
      TimerContext prepareTimer = Metrics.defaultRegistry().newTimer(CQLExecutor.class, "statement.prepared").time();
      PreparedStatement ret = session.prepare(cql.getQuery());
      prepareTimer.stop();
      ret.setConsistencyLevel(consistencyLevel);
      preparedStatementCache.put(cql.getQuery(), ret);
      return ret;
    }
    }
View Full Code Here

    Futures.addCallback(future, new FutureCallback<ResultSet>() {
      @Override
      public void onSuccess(final ResultSet result) {
        Host queriedHost = result.getExecutionInfo().getQueriedHost();
        Metrics.defaultRegistry().newMeter(StatementIteratorConsumer.class, "queriedhost." + queriedHost.getDatacenter(), queriedHost.getDatacenter(), TimeUnit.SECONDS).mark();
        asyncExecTimerContext.stop();
        logger.debug("Async exec time {}us", (System.nanoTime() - startTime) / 1000);
        shutdownLatch.countDown();
      }

      @Override
View Full Code Here

        shutdownLatch.countDown();
      }

      @Override
      public void onFailure(final Throwable t) {
        asyncExecTimerContext.stop();
        logger.debug("Async failure time {}us", (System.nanoTime() - startTime) / 1000);
        executionExceptions.add(t);
        shutdownLatch.countDown();
      }
    }
View Full Code Here

                                (exceptionMessage == null) ? "" : "(" + exceptionMessage + ")"));
        }

        session.operations.getAndIncrement();
        session.keys.getAndIncrement();
        context.stop();
    }
}
View Full Code Here

            // convert max key found back to an integer, and increment it
            startOffset = String.format(format, (1 + getMaxKey(results.rows)));

            session.operations.getAndIncrement();
            session.keys.getAndAdd(results.rows.size());
            context.stop();
        }
    }

    /**
     * Get maximum key from CqlRow list
View Full Code Here

                                cqlQuery));
        }

        session.operations.getAndIncrement();
        session.keys.getAndIncrement();
        context.stop();
    }
}
View Full Code Here

                                cqlQuery));
        }

        session.operations.getAndIncrement();
        session.keys.getAndIncrement();
        context.stop();
    }
}
View Full Code Here

                                (exceptionMessage == null) ? "" : "(" + exceptionMessage + ")"));
        }

        session.operations.getAndIncrement();
        session.keys.getAndIncrement();
        context.stop();
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.