[
https://issues.apache.org/jira/browse/DELTASPIKE-580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13975131#comment-13975131
]
Mark Struberg commented on DELTASPIKE-580:
------------------------------------------
doing almost the same in the transaction interceptor
{code}
@Alternative
@Dependent
public class MyProjectTransactionStrategy extends
BeanManagedUserTransactionStrategy {
@Override
public Object execute(InvocationContext invocationContext) throws Exception
{
long start = System.nanoTime();
try {
return super.execute(invocationContext);
}
finally {
long duration = System.nanoTime() - start;
if (duration > threshold) {
logger.info("SLOW SERVICE DETECTED: time: {} ms {}#{} params =
{}",
TimeUnit.NANOSECONDS.toMillis(duration),
invocationContext.getMethod().getDeclaringClass(),
invocationContext.getMethod().getName(),
ArrayUtils.toString(invocationContext.getParameters()));
}
}
}
...
{code}
works good enough for me
> @InvocationMonitored
> --------------------
>
> Key: DELTASPIKE-580
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-580
> Project: DeltaSpike
> Issue Type: New Feature
> Components: Core
> Reporter: Gerhard Petracek
> Assignee: Gerhard Petracek
> Attachments: DELTASPIKE-580_first_draft.patch
>
>
> use-cases to support:
> - exception monitoring
> - performance monitoring (via execution time)
> - auditing (with or without parameter values)
--
This message was sent by Atlassian JIRA
(v6.2#6252)