Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect calling statistics #169

Closed
borysl opened this issue Nov 20, 2015 · 1 comment
Closed

Incorrect calling statistics #169

borysl opened this issue Nov 20, 2015 · 1 comment

Comments

@borysl
Copy link

borysl commented Nov 20, 2015

I have run zorka with a single application, put tracing to file and received not quite correct data:
zorka_incorrect_stats

Object org.springframework.web.context.request.AbstractRequestAttributesScope.get(String, ObjectFactory) took over 1 second and over 65% of entire time.
However it consists of only method that took less than 18%. The method itself is very simple

@Override
public Object get(String name, ObjectFactory<?> objectFactory) {
    RequestAttributes attributes = RequestContextHolder.currentRequestAttributes();
    Object scopedObject = attributes.getAttribute(name, getScope());
    if (scopedObject == null) {
        scopedObject = objectFactory.getObject();
        attributes.setAttribute(name, scopedObject, getScope());
    }
    return scopedObject;
}

This code doesn't seem to have anything that can slow down purely to 0,8 seconds.

Also there are AOP methods, but how can I trace how much do they take?

@jitlogic
Copy link
Owner

jitlogic commented Dec 8, 2017

In some circumstances it can. For example if GC pause occurs when method is executing. Tracer simply registers current time at the beginning of method, at the end of method and records difference.

Now there is another issue: sometime method execution time is bigger than sum of all registered methods called from it. There can be several causes of such behavior: some classes/methods can be excluded from tracing or automatically filtered out by tracer. Also in some circumstances tracer overflow can occur, ie. tracer will stop registering methods in order to not eat too much memory. See tracer.max.trace.records setting in zorka.properties.

@jitlogic jitlogic closed this as completed Dec 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants