Kentico 12 MVC Debugging with Glimpse

John Jones asked on May 6, 2019 18:15

Hello,

If we add Glimpse to our solution during development will this degrade performance if it is in production code? Can we just toggle glimpse off in production and it will not cause any performance issues? I know we should add security to restrict access to the glimpse page as well. Can we disable glimpse from running on every request so it does not degrade performance on production unless we enable it?

Thank you,

Recent Answers


Michal Samuhel answered on May 7, 2019 08:24 (last edited on May 7, 2019 08:25)

Hi, Glimpse as any extra code executed can add an overhead and simple rule of thumb would be, to exclude any and all additional code from production set up. However, overhead could not be that much. You can set glimpse by security policy, to log only requests coming from local machine (granted, that request recognition takes a milisecond...):

http://blog.getglimpse.com/category/configuration/

Or disable execution on RunTime events alltogether:

https://docs.microsoft.com/en-us/aspnet/mvc/overview/performance/profile-and-debug-your-aspnet-mvc-app-with-glimpse

Though glimpse itself seems to be be just in maintenance mode given the state of repository:

https://github.com/Glimpse

You can try other tools, such as for example:

https://stackify.com/prefix/

0 votesVote for this answer Mark as a Correct answer

Dmitry Bastron answered on May 7, 2019 12:28

Hi John,

By default Glimpse is enabled on local environments only and won't run on production until you add this into your web.config:

<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
    <runtimePolicies>
        <ignoredTypes>
            <add type="Glimpse.AspNet.Policy.LocalPolicy, Glimpse.AspNet" />
        </ignoredTypes>
    </runtimePolicies>
</glimpse>

I tested it myself when after the first Live rollout we accidentally left Glimpse installed (but without ignoring the Local policy listed above) and Glimpse didn't work without it. And I haven't noticed any negative performance impact (it should be, of course, as Michal mentioned, one small check is performed on the code but it looks like an extra small "if" statement if Glimpse is disabled on Live site).

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.