Package com.yammer.metrics.core

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


                    DirectPosition eastNorth = new GeneralDirectPosition(eastings, northings);
                    DirectPosition latLng = osgbToWgs84Transform.transform(eastNorth, eastNorth);

                    unit.location = new Location(round(latLng.getOrdinate(1), 8), round(latLng.getOrdinate(0), 8));
                } finally {
                    latLongCtx.stop();
                }
            } catch (NumberFormatException e) {
                throw new RuntimeException("NumberFormatException parsing easting/northings '" + entry.getEastings() + ", " + entry.getNorthings() + "'.");
            } catch (TransformException e) {
                throw Throwables.propagate(e);
View Full Code Here


                postcodesProcessed.inc();
            } catch (MongoException.DuplicateKey e) {
                // ignore
            } finally {
                saveCtx.stop();
            }
        }
    }

    public static double round(double valueToRound, int numberOfDecimalPlaces) {
View Full Code Here

    public static BufferedImage rotate(BufferedImage image, Scalr.Rotation rotation) throws Exception {
        TimerContext rotateContext = rotateTimer.time();
        BufferedImage result = AsyncScalr.rotate(image, rotation).get();
        image.flush();
        rotateContext.stop();
        return result;
    }

    public static BufferedImage fitToWidth(BufferedImage image, int width) throws Exception {
        // TODO: Don't ever make an image bigger
View Full Code Here

    public static BufferedImage fitToWidth(BufferedImage image, int width) throws Exception {
        // TODO: Don't ever make an image bigger
        TimerContext resizeContext = resizeTimer.time();
        BufferedImage result = AsyncScalr.resize(image, Scalr.Mode.FIT_TO_WIDTH, width).get();
        image.flush();
        resizeContext.stop();
        return result;
    }

    public static BufferedImage crop(BufferedImage image, Rectangle bounds) throws Exception {
        TimerContext cropContext = cropTimer.time();
View Full Code Here

    public static BufferedImage crop(BufferedImage image, Rectangle bounds) throws Exception {
        TimerContext cropContext = cropTimer.time();
        BufferedImage result = AsyncScalr.crop(image, bounds.x, bounds.y, bounds.width, bounds.height).get();
        image.flush();
        cropContext.stop();
        return result;
    }
}
View Full Code Here

            TimerContext readContext = readTimer.time();
            try {
                image = ImageIO.read(imageStream);
            } finally {
                imageStream.close();
                readContext.stop();
            }

            if (crop != null) {
                image = com.thousandmemories.photon.core.Processor.crop(image, crop.get());
            }
View Full Code Here

      }
    } catch (Exception e) {
      LOG.error("Unknown error while trying to fetch row.", e);
      throw new BException(e.getMessage(), e);
    } finally {
      timerContext.stop();
      if (!usedCache && searcher != null) {
        // if the cached search was not used, close the searcher.
        // this will allow for closing of index
        try {
          searcher.close();
View Full Code Here

    } catch (Exception e) {
      LOG.error("Unknown error while trying to fetch row.", e);
      throw new BException(e.getMessage(), e);
    } finally {
      trace.done();
      timerContext.stop();
      if (!usedCache && searcher != null) {
        // if the cached search was not used, close the searcher.
        // this will allow for closing of index
        try {
          searcher.close();
View Full Code Here

          context.progress();
          TimerContext computeOneTimerContext = computeOneTimer.time();
          try {
            vertex.compute(messages);
          } finally {
            computeOneTimerContext.stop();
          }
          // Need to unwrap the mutated edges (possibly)
          vertex.unwrapMutableEdges();
          // Write vertex to superstep output (no-op if it is not used)
          vertexWriter.writeVertex(vertex);
View Full Code Here

      numRows += readFully(reader);
    }

    System.err.println("Parsed " + numRows + " rows");

    allTimerContext.stop();

    new ConsoleReporter(System.err).run();
  }

  /**
 
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.