Class ImageMetrics


  • @Component
    public class ImageMetrics
    extends Object
    Small component to allow for convenient measurements of image data operations.
    • Constructor Detail

      • ImageMetrics

        public ImageMetrics​(io.micrometer.core.instrument.MeterRegistry registry)
    • Method Detail

      • clearTimer

        public void clearTimer​(int key)
      • clearStaleTimers

        @Scheduled(fixedRate=15L,
                   timeUnit=MINUTES)
        public void clearStaleTimers()
        Clear out stale timers once in a while to prevent a memory leak from failed tasks that don't clean up after themselves.
      • startImageOp

        public int startImageOp()
        Start measuring an image operation.
        Returns:
        Key to stop the measurement with.
      • endImageOp

        public void endImageOp​(int key,
                               ImageMetrics.ImageDataOp op,
                               String format,
                               int numPixels)
        End measuring an image operation with some metadata.