Class ImageMetrics
- java.lang.Object
-
- de.digitalcollections.iiif.hymir.image.business.ImageMetrics
-
@Component public class ImageMetrics extends Object
Small component to allow for convenient measurements of image data operations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImageMetrics.ImageDataOp
-
Constructor Summary
Constructors Constructor Description ImageMetrics(io.micrometer.core.instrument.MeterRegistry registry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearStaleTimers()Clear out stale timers once in a while to prevent a memory leak from failed tasks that don't clean up after themselves.voidclearTimer(int key)voidendImageOp(int key, ImageMetrics.ImageDataOp op, int numPixels)voidendImageOp(int key, ImageMetrics.ImageDataOp op, String format, int numPixels)End measuring an image operation with some metadata.intstartImageOp()Start measuring an image operation.
-
-
-
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, int numPixels)
-
endImageOp
public void endImageOp(int key, ImageMetrics.ImageDataOp op, String format, int numPixels)End measuring an image operation with some metadata.
-
-