tritium icon indicating copy to clipboard operation
tritium copied to clipboard

Add `@SlowLog(duration,unit)` annotation

Open schlosna opened this issue 8 years ago • 3 comments

From @markelliot: I'd like to annotate some methods with @SlowLog(duration,unit) such that if the method takes longer than that execute we log the method and the parameters to record that it ran slower than expected.

A similar enhancement would be to do this for slowest 1% of method calls.

@ellisjoe @ash211 for SA

schlosna avatar May 11 '17 21:05 schlosna

this would be great

ellisjoe avatar May 11 '17 21:05 ellisjoe

Interested in feedback on what logger this would go to, at what level, and if you'd annotate the instrumented interface and/or implementation?

schlosna avatar May 11 '17 23:05 schlosna

think for services we'll want to stick them on the implementation. the service interfaces currently just define the rest api and this seems like something directly related to a specific implementation anyway.

if we're logging just the slowest 1% we should likely log at INFO. if we we're able to log calls that appear to be outliers, think those would be better logged at WARN (taking the stance that WARN logs are something we should take a look at within a day or so).

could see this being logged to the same place as the rest of metrics or it's own file. don't have a strong opinion there.

ellisjoe avatar May 13 '17 16:05 ellisjoe