Re: Set Global Value

From: Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>
To: "Silvera, Ignacio" <ignacio(dot)silvera(at)atos(dot)net>
Cc: Khushboo Vashi <khushboo(dot)vashi(at)enterprisedb(dot)com>, "pgadmin-support(at)lists(dot)postgresql(dot)org" <pgadmin-support(at)lists(dot)postgresql(dot)org>
Subject: Re: Set Global Value
Date: 2017-09-22 12:23:06
Message-ID: CAG7mmoyaD6EC+41wXxbAh6ikhPEfAakwLbHim1w32tcjYMZRsw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

On Fri, Sep 22, 2017 at 5:47 PM, Silvera, Ignacio <ignacio(dot)silvera(at)atos(dot)net>
wrote:

> Hi!
> I have found the tricky way to do that.
> Maybe someone could be interested. Take care that it is not recommended,
> because prorbably in future updates the following config will be lost
>
> STEPS
> 1- Find the file __init.py__ in the pgadmin installation folder, under
> dashboard directory( in my install the path is: )
> 2- Find the following def: register_preferences(self):
> 3- Edit the def as showing below in the example
>
> *BEFORE CHANGE*
>
> self.session_stats_refresh = self.dashboard_preference.register(
> 'dashboards', 'tps_stats_refresh',
> gettext("Transaction throughput refresh rate"), 'integer',
> 1, min_val=1, max_val=999999,
> category_label=gettext('Graphs'),
> help_str=gettext('The number of seconds between graph
> samples.')
>
> *AFTER*
>
> self.session_stats_refresh = self.dashboard_preference.register(
> 'dashboards', 'tps_stats_refresh',
> gettext("Transaction throughput refresh rate"), 'integer',
> *60*, min_val=*60*, max_val=999999,
> category_label=gettext('Graphs'),
> help_str=gettext('The number of seconds between graph
> samples.')
>
Hi Ignacio,

Yes - these changes will work for now.
But - you may need to make the same change again for every upgrade.

Would you please create a feature request on redmine for the same, so that
- we can make it configurable?

-- Thanks, Ashesh

>
> You should do it with all the parameters that you want to modify.
>
> With this tricky way you can also setup the min value, so you can be sure
> that nothing could put less than you explicited in the file.
>
> I hope it help to more people!
>
> Regards
>
> [image: blue_strip]
>
> *Ignacio Silvera*
>
> B&PS (Business & Platform Solutions) – Atos Uruguay
>
> Tel: +598 24871169, int 102
>
> ignacio(dot)silvera(at)atos(dot)net
>
> Luis A. de Herrera 2802
> <https://maps.google.com/?q=Luis+A.+de+Herrera+2802%0D+Montevideo,+Uruguay&entry=gmail&source=g>
>
> Montevideo, Uruguay
> <https://maps.google.com/?q=Luis+A.+de+Herrera+2802%0D+Montevideo,+Uruguay&entry=gmail&source=g>
>
> Atos.net
>
> [image: atos_logotype]
>
> This e-mail and the documents attached are confidential and intended
> solely for the addressee; it may also be privileged. If you receive this
> e-mail in error, please notify the sender immediately and destroy it. As
> its integrity cannot be secured on the Internet, the Atos group liability
> cannot be triggered for the message content. Although the sender endeavors
> to maintain a computer virus-free network, the sender does not warrant that
> this transmission is virus-free and will not be liable for any damages
> resulting from any virus transmitted.
>
>
> El 21/09/17 a las 23:49, Khushboo Vashi escribió:
>
> Hi,
>
> On Thu, Sep 21, 2017 at 9:03 PM, Silvera, Ignacio <
> ignacio(dot)silvera(at)atos(dot)net> wrote:
>
>> Hi! How are you? I'm new on pgAdmin4.
>>
>> I need to set the refresh of Dashboards globally to all users. We need to
>> set all the variables (I/O statistics, sessions statistics, etc) on 60
>> seconds to all users permamnent, and do not permit to modifiy it.
>>
> You can set the refresh rate of the Graphs per user through File >
> Preferences dialogue.
> In the Preferences dialogue select Dashboards > Graphs to set the desired
> values.
>
> Right now, you can not restrict users to modify them and also can't set it
> globally for all the users, it should be per user basis.
>
>> We installed pgAdmin4 following the next link:
>> http://yallalabs.com/linux/how-to-install-pgadmin-4-in-deskt
>> op-mode-on-ubuntu-16-04/
>>
>> I found the code on /opt/pgAdmin4/.pgadmin4/lib/py
>> thon2.7/site-packages/pgadmin4/pgadmin/dashboard/__init__.py and the
>> following code:
>>
>> self.session_stats_refresh = self.dashboard_preference.register(
>> 'dashboards', 'session_stats_refresh',
>> gettext("Session statistics refresh rate"), 'integer',
>> 1, min_val=1, max_val=999999,
>> category_label=gettext('Graphs'),
>> help_str=gettext('The number of seconds between graph
>> samples.')
>> )
>>
>> self.session_stats_refresh = self.dashboard_preference.register(
>> 'dashboards', 'tps_stats_refresh',
>> gettext("Transaction throughput refresh rate"), 'integer',
>> 1, min_val=1, max_val=999999,
>> category_label=gettext('Graphs'),
>> help_str=gettext('The number of seconds between graph
>> samples.')
>> )
>>
>> self.session_stats_refresh = self.dashboard_preference.register(
>> 'dashboards', 'ti_stats_refresh',
>> gettext("Tuples in refresh rate"), 'integer',
>> 1, min_val=1, max_val=999999,
>> category_label=gettext('Graphs'),
>> help_str=gettext('The number of seconds between graph
>> samples.')
>> )
>>
>> self.session_stats_refresh = self.dashboard_preference.register(
>> 'dashboards', 'to_stats_refresh',
>> gettext("Tuples out refresh rate"), 'integer',
>> 1, min_val=1, max_val=999999,
>> category_label=gettext('Graphs'),
>> help_str=gettext('The number of seconds between graph
>> samples.')
>> )
>>
>> self.session_stats_refresh = self.dashboard_preference.register(
>> 'dashboards', 'bio_stats_refresh',
>> gettext("Block I/O statistics refresh rate"), 'integer',
>> 1, min_val=1, max_val=999999,
>> category_label=gettext('Graphs'),
>> help_str=gettext('The number of seconds between graph
>> samples.')
>> )
>>
>> Thanks in advance!
>>
>> Regards
>> --
>>
>> [image: blue_strip]
>>
>> *Ignacio Silvera*
>>
>> B&PS (Business & Platform Solutions) – Atos Uruguay
>>
>> Tel: +598 24871169, int 102
>>
>> ignacio(dot)silvera(at)atos(dot)net
>>
>> Luis A. de Herrera 2802
>> <https://maps.google.com/?q=Luis+A.+de+Herrera+2802%0D+Montevideo,+Uruguay&entry=gmail&source=g>
>>
>> Montevideo, Uruguay
>> <https://maps.google.com/?q=Luis+A.+de+Herrera+2802%0D+Montevideo,+Uruguay&entry=gmail&source=g>
>>
>> Atos.net
>>
>> [image: atos_logotype]
>>
>> This e-mail and the documents attached are confidential and intended
>> solely for the addressee; it may also be privileged. If you receive this
>> e-mail in error, please notify the sender immediately and destroy it. As
>> its integrity cannot be secured on the Internet, the Atos group liability
>> cannot be triggered for the message content. Although the sender endeavors
>> to maintain a computer virus-free network, the sender does not warrant that
>> this transmission is virus-free and will not be liable for any damages
>> resulting from any virus transmitted.
>>
>>
>>
>
> Thanks,
> Khushboo
>
>
>

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Silvera, Ignacio 2017-09-22 12:25:18 Re: Set Global Value
Previous Message Silvera, Ignacio 2017-09-22 12:17:25 Re: Set Global Value