hugo icon indicating copy to clipboard operation
hugo copied to clipboard

flag methods w/ times > N msec as errors

Open kenyee opened this issue 10 years ago • 1 comments

E.g., during debug, I'd want to be able to flag methods that take "too long", e.g., DB access methods that take over 1sec and if that happens, put a msg in the log at a warning level. So instead of @DebugLog, maybe add "@DebugLogSlug(1000)" for anything that goes over 1sec?

kenyee avatar Jan 19 '15 15:01 kenyee

I started working on this yesterday, though I don't know if it's in the scope of Hugo or if I should make a performance focused fork. I mainly want this to be able to annotate tests and detect performance degrades.

At the moment I have an annotation that looks this (with an optional TimeUnit): @Performance(limit=1000) If the limit is exceeded in app code, a warning is printed, in test code the test should fail (I'll most likely split this into two annotations). Still early in development so I can't say how useful it turns out to be, but if it works I'd be happy to contribute (if it fits the scope) or publish a fork.

fejd avatar Jul 07 '15 20:07 fejd