Admin setting to enable or disable mini-profiler?

Continuing the discussion from How can you hide the MiniProfiler?:

Is this (in the admin settings) something possible to do? Since the mini-profiler is always on the left side of the screen, it’s often in the way for a language that has left-to-right reading and left-justified text. It’d be great if we could toggle it on only when needed for troubleshooting.

3 Likes

You can press alt+P to hide or show it at any time.

18 Likes

Where could I have learned that alt-p trick?

4 Likes

It’s in the source code, at the bottom of the page:

 data-toggle-shortcut="Alt+P" data-start-hidden="false"></script>
5 Likes

@codinghorror I use

chrome-extension://jlpkojjdgbllmedoapgfodplfhcbnbpn/update.html#help

Which uses Alt-P… :frowning:

Any chance that the keyboard shortcut could be configurable, or can be eventually turned off/on via the admin settings?

Did you try disabling your extension for a moment, then disabling the profiler, then re-enabling your extension? Seems like that would do it.

1 Like

Hi @downey, is this first message still accurate? You reference enable_mini_profiler but here in Github the flag appears to be named load_mini_profiler

Also, after changing this setting, do I need to do an app reload, an app rebuild, or nothing (changes take effect immediately)?

Thanks-- E

2 Likes

Well much has changed in 5 years. I don’t know about a global disable, someone else might. AFAIK the Alt+P still works.

4 Likes

Thanks for your reply. I noticed it appear one day and had no idea why, so your answer helped a lot.

2 Likes

Apparently the mini profiler interface only appears for users that are designated as developers, not just any admin. Is that right?

Yes, only users in the developers role will see it.

1 Like

What if there isn’t ALT-key… like in my iPhone or logitech-made-mac-keybord of iPad?

This isn’t any bigger issue and like to see snapshot of loading time, but when I take screenshots for users it looks a bit odd.

Note it is only visible to developers (you need to explicitly insert a row into a table)

You can always use the UI directly to tweak visibility.

2 Likes

How is a user added or removed from the “developer role”. I don’t see a group for that.

1 Like

As standard it’s matched by the email address specified in the app.yml

If you want to add it to other users you need to edit the database directly.

3 Likes

You can put multiple developers in DISCOURSE_DEVELOPER_EMAILS in app.yml by separating them with commas. Removing the email from that variable also removes them from the role unless you have contrived to add that to the database (which I didn’t know was possible).

6 Likes

I just personally fell prey to the lack of info in the UI about the mini-profiler, what it is, what it is called, why it is shown to me, and how to hide it. I set up sites but am not a developer, so don’t ever need to see it but have just gotten used to it.

At a minimum, I suggest that we update the documentation to explain the current behavior:

Beyond that, if possible I’d like to see help text for those who are confused about it and want to make it go away eg “Miniprofiler - press ALT+P to toggle display”.

The below seems to be a good step by step guide to adding it for a user on your site.

3 Likes

Maybe it should just default to off. Then people who want it can turn it on and no one else will know.

4 Likes

Yeah, I am attracted to that idea. Even if you are in DISCOURSE_DEVELOPER_EMAILS it would default to off.

I noticed that when I removed my email address from DISCOURSE_DEVELOPER_EMAILS in app.yml and did a rebuild, I lost the miniprofiler entirely. I would have expected it to still show up using ALT+P but likely there are some technical details I am not aware of.

2 Likes

That’s what makes is possible for you to see the miniprofiler.

But it could be changed to default off, and people who wanted it could ALT-P to turn it on. I think that would solve this problem for most everyone. I doubt that if it gets turned off by default a bunch of people will be asking how to turn it back on (and I presume that the shortcut is in the shortcuts menu)

2 Likes