public inbox for [email protected]
help / color / mirror / Atom feedFrom: Aditya Toshniwal <[email protected]>
To: Akshay Joshi <[email protected]>
Cc: Dave Page <[email protected]>
Cc: Khushboo Vashi <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Subject: Re: [pgAdmin4][RM3941] Dashboard graphs needs optimizations
Date: Mon, 4 Feb 2019 16:17:06 +0530
Message-ID: <CAM9w-_neMQN4Yy7-ckGFBi2JUG-GFpB-idTtLgGie2rjGZXufA@mail.gmail.com> (raw)
In-Reply-To: <CANxoLDc44_KiXmt53oOaPBxqsF5L2GHpNiwZpmDBtR=bgMGGGQ@mail.gmail.com>
References: <CAM9w-_=uidEaAy=VH8VWq5YpvWSCjZFUt=WNaRt6dyhUYC6WXA@mail.gmail.com>
<CANxoLDfDJayFiSpsBf+nFW74c5VOsNgsDKfRTrLaCQe=MDOuwg@mail.gmail.com>
<CAFOhELdah8SNhc+eiqDUewNY21DmqrUr2FkPRyRcwPkXKNdoeg@mail.gmail.com>
<CA+OCxox+2nDXK9gjg9B4ZVujEuAKCUKi5dCLL=1NZiBZODAKOA@mail.gmail.com>
<CAM9w-_kj8qVkOO7VNt3qumUHK21OvkAgE=T+YdwOEDJ07Ue-8A@mail.gmail.com>
<CANxoLDc44_KiXmt53oOaPBxqsF5L2GHpNiwZpmDBtR=bgMGGGQ@mail.gmail.com>
Hi Hackers,
Attached is the patch to change the dashboard test cases to fetch server_id
similar to how it is done in other test cases.
Kindly review.
On Mon, Feb 4, 2019 at 3:43 PM Akshay Joshi <[email protected]>
wrote:
> Thanks patch applied.
>
> On Mon, Feb 4, 2019 at 3:27 PM Aditya Toshniwal <
> [email protected]> wrote:
>
>> Hi Hackers,
>>
>> Attached is the updated patch. The poller will wait 3 times the normal
>> interval before sending new request if the previous request is pending.
>> After that, it will send the ajax.
>>
>> Kindly review.
>>
>> On Mon, Feb 4, 2019 at 3:12 PM Dave Page <[email protected]> wrote:
>>
>>> I can't get to this right now, but Akshay, can we get it in before the
>>> release?
>>>
>>> I don't think the problem Khushboo notes is really a problem. Waiting
>>> for a response before issuing another one seems sensible... as long as
>>> there's a timeout so things don't get stuck if a response gets lost
>>> somehow. Maybe the timeout should be something like 3x the normal interval?
>>>
>>> On Mon, Feb 4, 2019 at 9:02 AM Khushboo Vashi <
>>> [email protected]> wrote:
>>>
>>>> Hi Aditya,
>>>>
>>>> I have reviewed the patch and it looks good to me except the logic to
>>>> wait until we get the response from the AJAX request.
>>>> So, in this case at a time only one request is being sent to the server.
>>>>
>>>> @ Dave/Ashesh, if you think this is okay then we can commit the patch.
>>>>
>>>> Thanks,
>>>> Khushboo
>>>>
>>>> On Mon, Feb 4, 2019 at 10:45 AM Akshay Joshi <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi Khushboo
>>>>>
>>>>> Can you please review it.
>>>>>
>>>>> On Fri, Feb 1, 2019 at 7:04 PM Aditya Toshniwal <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Hi Hackers,
>>>>>>
>>>>>> Attached is the patch to optimise the dashboard. Changes include:
>>>>>> 1) One ajax request for the all the charts instead of separate for
>>>>>> every chart. The next request will not hit until the previous is completed.
>>>>>> 2) The code will check for intervals which is greatest common divisor
>>>>>> of all the refresh rates. Chart names which will be eligible for refresh
>>>>>> will be sent with the ajax. If none are eligible, no ajax will be fired.
>>>>>> 3) In the backend, query is generated in such a way that data for all
>>>>>> the requested chart names will be fetched in one hit to the database.
>>>>>> 4) Test cases for charts rest api and javascript added.
>>>>>>
>>>>>> --
>>>>>> Thanks and Regards,
>>>>>> Aditya Toshniwal
>>>>>> Software Engineer | EnterpriseDB Software Solutions | Pune
>>>>>> "Don't Complain about Heat, Plant a tree"
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> *Akshay Joshi*
>>>>>
>>>>> *Sr. Software Architect *
>>>>>
>>>>>
>>>>>
>>>>> *Phone: +91 20-3058-9517Mobile: +91 976-788-8246*
>>>>>
>>>>
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>
>>
>> --
>> Thanks and Regards,
>> Aditya Toshniwal
>> Software Engineer | EnterpriseDB Software Solutions | Pune
>> "Don't Complain about Heat, Plant a tree"
>>
>
>
> --
> *Akshay Joshi*
>
> *Sr. Software Architect *
>
>
>
> *Phone: +91 20-3058-9517Mobile: +91 976-788-8246*
>
--
Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB Software Solutions | Pune
"Don't Complain about Heat, Plant a tree"
Attachments:
[application/octet-stream] RM3941.apitest.patch (2.9K, 3-RM3941.apitest.patch)
download | inline diff:
diff --git a/web/pgadmin/dashboard/tests/test_dashboard_graphs.py b/web/pgadmin/dashboard/tests/test_dashboard_graphs.py
index 90380c2f..b9371a5a 100644
--- a/web/pgadmin/dashboard/tests/test_dashboard_graphs.py
+++ b/web/pgadmin/dashboard/tests/test_dashboard_graphs.py
@@ -9,6 +9,7 @@
from pgadmin.utils.route import BaseTestGenerator
from pgadmin.utils import server_utils as server_utils
+from regression import parent_node_dict
import simplejson as json
@@ -21,42 +22,36 @@ class DashboardGraphsTestCase(BaseTestGenerator):
scenarios = [(
'TestCase for session_stats graph', dict(
- sid=1,
did=-1,
chart_data={
'session_stats': ['Total', 'Active', 'Idle'],
}
)), (
'TestCase for tps_stats graph', dict(
- sid=1,
did=-1,
chart_data={
'tps_stats': ['Transactions', 'Commits', 'Rollbacks'],
}
)), (
'TestCase for ti_stats graph', dict(
- sid=1,
did=-1,
chart_data={
'ti_stats': ['Inserts', 'Updates', 'Deletes'],
}
)), (
'TestCase for to_stats graph', dict(
- sid=1,
did=-1,
chart_data={
'to_stats': ['Fetched', 'Returned'],
}
)), (
'TestCase for bio_stats graph', dict(
- sid=1,
did=-1,
chart_data={
'bio_stats': ['Reads', 'Hits'],
}
)), (
'TestCase for two graphs', dict(
- sid=1,
did=-1,
chart_data={
'session_stats': ['Total', 'Active', 'Idle'],
@@ -64,7 +59,6 @@ class DashboardGraphsTestCase(BaseTestGenerator):
}
)), (
'TestCase for five graphs', dict(
- sid=1,
did=-1,
chart_data={
'session_stats': ['Total', 'Active', 'Idle'],
@@ -75,7 +69,6 @@ class DashboardGraphsTestCase(BaseTestGenerator):
}
)), (
'TestCase for no graph', dict(
- sid=1,
did=-1,
chart_data={},
))
@@ -92,10 +85,11 @@ class DashboardGraphsTestCase(BaseTestGenerator):
return base_url
def runTest(self):
- server_response = server_utils.connect_server(self, self.sid)
+ self.server_id = parent_node_dict["server"][-1]["server_id"]
+ server_response = server_utils.connect_server(self, self.server_id)
if server_response["info"] == "Server connected.":
- url = self.getStatsUrl(self.sid, self.did,
+ url = self.getStatsUrl(self.server_id, self.did,
",".join(self.chart_data.keys()))
response = self.tester.get(url)
self.assertEquals(response.status_code, 200)
view thread (12+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: [pgAdmin4][RM3941] Dashboard graphs needs optimizations
In-Reply-To: <CAM9w-_neMQN4Yy7-ckGFBi2JUG-GFpB-idTtLgGie2rjGZXufA@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox