Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gqbmp-0004bd-4h for pgadmin-hackers@arkaria.postgresql.org; Mon, 04 Feb 2019 10:47:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gqbmn-0003bL-RM for pgadmin-hackers@arkaria.postgresql.org; Mon, 04 Feb 2019 10:47:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gqbmn-0003Xj-D9 for pgadmin-hackers@lists.postgresql.org; Mon, 04 Feb 2019 10:47:33 +0000 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gqbmZ-0003ZX-NA for pgadmin-hackers@postgresql.org; Mon, 04 Feb 2019 10:47:31 +0000 Received: by mail-lj1-x241.google.com with SMTP id k19-v6so11083482lji.11 for ; Mon, 04 Feb 2019 02:47:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5YfEEJaBoSEFn1EMNKtQE7hRjc24h5pNZHqtyoa6Wlc=; b=OiZIZA7ASHgtTbn35yUkVH8oz49d8eMMDLQQwlC6dQEruTqMwOmIPEumLHdhb5PZcn Osa2iFJi8FVVgG1aCx81jYWm4kENWHl2KRArM8IgApRf3MdgCl30pSkzlzodEWsmJu1P Pi0HVPg69gsYzC+GavmoHoCnywX7++fNoh9N9XkpnSszAtGJisS+BXbXlZ2ADxPMn0+a FyCEFTW8ENJjS4VncIVkQbycR4lLhZpE07HBFTqNUYY+anUapMM3c8hyOqQXHPC8MXh8 ax5o23qtHbgzUteoNwCUj4uz93y0nZbX9QEhsw20YpDfhaxm8oBTwKQ1zegBBvNY7lUk KVyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5YfEEJaBoSEFn1EMNKtQE7hRjc24h5pNZHqtyoa6Wlc=; b=N8pVROOUmBy1rdWfEraly28HFWWaMW8RgKsvElwlXLGuy2y3r48PEm/NFjX0Jio3NU f//ZWi3wi1dXhzZVsDJzi0Sxs0CxfzL/26fQf6AhneHaRIJUE7sQA7mdLygU4QbfbQk9 X+U2tzWd+wgr6sY6NCo/wfTUJXKnNor9l1tLwfh1Sysf6xibbwDq5nNYtIQzlOBtoczD NRWsvCH/MBMuSqlTC1YzNqcwQ+V+nGRotj/Io5cSYXVj+Dg+0mP2EI5CH/2IdGJOR36L YfF3QkJxiCjIsVIlj7S0GWFrRJ7DcdvooGPv8B0X5b+kBYIGcK8Vp6KNiW8SZ8liEPB7 +gwQ== X-Gm-Message-State: AJcUukfQqGI2fkMI5jtLelYONOnPwlHZrv29MAWYBH8TFkIXUKI1IPWG EYIPKFO7GImasYxP+r8EEwhvDxOjFKKKEs2H8Uogbw== X-Google-Smtp-Source: ALg8bN5tKkAzjqM0l+DvyooNVYkfHB9kjpgYYByVNTP2gmzpAZ8fEPk9urkpWbHSyoi1cvw8yFGVIiPiWiQ/V/DOSFA= X-Received: by 2002:a2e:9d17:: with SMTP id t23-v6mr31624839lji.57.1549277237737; Mon, 04 Feb 2019 02:47:17 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Aditya Toshniwal Date: Mon, 4 Feb 2019 16:17:06 +0530 Message-ID: Subject: Re: [pgAdmin4][RM3941] Dashboard graphs needs optimizations To: Akshay Joshi Cc: Dave Page , Khushboo Vashi , pgadmin-hackers Content-Type: multipart/mixed; boundary="0000000000006a41e605810f3746" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --0000000000006a41e605810f3746 Content-Type: multipart/alternative; boundary="0000000000006a41e405810f3744" --0000000000006a41e405810f3744 Content-Type: text/plain; charset="UTF-8" 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 wrote: > Thanks patch applied. > > On Mon, Feb 4, 2019 at 3:27 PM Aditya Toshniwal < > aditya.toshniwal@enterprisedb.com> 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 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 < >>> khushboo.vashi@enterprisedb.com> 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 < >>>> akshay.joshi@enterprisedb.com> wrote: >>>> >>>>> Hi Khushboo >>>>> >>>>> Can you please review it. >>>>> >>>>> On Fri, Feb 1, 2019 at 7:04 PM Aditya Toshniwal < >>>>> aditya.toshniwal@enterprisedb.com> 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" --0000000000006a41e405810f3744 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Hackers,

Attached is the patch to change the dashboard = test cases to fetch server_id similar to how it is done=C2=A0in other test = cases.

Kindly review.

On Mon, Feb 4, 2019 at 3:43 PM Akshay Joshi= <akshay.joshi@enterpri= sedb.com> wrote:
Thanks patch applied.

On Mon, Feb 4, 2019 at 3:27 P= M Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote:
Hi Hackers,=

Attached is the updated patch. The poller will wait 3 times the norma= l interval before sending new request if the previous request is pending. A= fter that, it will send the ajax.

Kindly review.

On Mon, Feb 4,= 2019 at 3:12 PM Dave Page <dpage@pgadmin.org> 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 fo= r a response before issuing another one seems sensible... as long as there&= #39;s a timeout so things don't get stuck if a response gets lost someh= ow. Maybe the timeout should be something like 3x the normal interval?

On Mon, Feb 4, 2019 at 9:02 AM Khushboo Vashi <khushboo.vashi@enterprisedb.co= m> wrote:
Hi Aditya,

I have reviewed the patch a= nd it looks good to me except the logic to wait until we get the response f= rom the AJAX request.
So, in this case at a time only one request= is being sent to the server.

@ Dave/Ashesh, if yo= u think this is okay then we can commit the patch.

Thanks,
Khushboo

On Mon, Feb 4, 2019 at 10:45 AM Akshay Jos= hi <a= kshay.joshi@enterprisedb.com> wrote:
Hi Khushboo

Can you please review it.

On Fri, Feb 1, 2019 at 7:04 PM Aditya Toshn= iwal <aditya.toshniwal@enterprisedb.com> wrote:
Hi Hackers,

Attached= is the patch to optimise the dashboard. Changes include:
1) One ajax req= uest for the all the charts instead of separate for every chart. The next r= equest 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. C= hart names which will be eligible for refresh will be sent with the ajax. I= f none are eligible, no ajax will be fired.
3) In the backend, query is gen= erated in such a way that data for all the requested chart names will be fe= tched in one hit to the database.
4) Test cases for charts rest api and j= avascript added.

--
Thanks and Regar= ds,
Aditya Toshniwal=
= Softwa= re Engineer |=C2=A0EnterpriseDB Software Solutions |=C2=A0Pune
&qu= ot;Don't Complain about Heat, Plant a tree"


--
Akshay Joshi
Sr. Software Archi= tect

<= b>

Phone: +91 20-3058-9517
Mobile: +91 976-788-8246


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twit= ter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Post= greSQL Company


--
Thanks and Regards,
Aditya Toshniwal
=
Software Engineer |=C2=A0E= nterpriseDB Software Solutions |=C2=A0P= une
"Don't Complai= n about Heat, Plant a tree"


--
Akshay Joshi
Sr. Software Architect
<= div>

Phone: +91 20-3058-9517
Mobi= le: +91 976-788-8246


--
Thanks and Rega= rds,
Aditya Toshniwa= l
Softw= are Engineer |=C2=A0EnterpriseDB Software Solutions |=C2=A0Pune
&q= uot;Don't Complain about Heat, Plant a tree"
--0000000000006a41e405810f3744-- --0000000000006a41e605810f3746 Content-Type: application/octet-stream; name="RM3941.apitest.patch" Content-Disposition: attachment; filename="RM3941.apitest.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_jrq7nnxl0 ZGlmZiAtLWdpdCBhL3dlYi9wZ2FkbWluL2Rhc2hib2FyZC90ZXN0cy90ZXN0X2Rhc2hib2FyZF9n cmFwaHMucHkgYi93ZWIvcGdhZG1pbi9kYXNoYm9hcmQvdGVzdHMvdGVzdF9kYXNoYm9hcmRfZ3Jh cGhzLnB5CmluZGV4IDkwMzgwYzJmLi5iOTM3MWE1YSAxMDA2NDQKLS0tIGEvd2ViL3BnYWRtaW4v ZGFzaGJvYXJkL3Rlc3RzL3Rlc3RfZGFzaGJvYXJkX2dyYXBocy5weQorKysgYi93ZWIvcGdhZG1p bi9kYXNoYm9hcmQvdGVzdHMvdGVzdF9kYXNoYm9hcmRfZ3JhcGhzLnB5CkBAIC05LDYgKzksNyBA QAogCiBmcm9tIHBnYWRtaW4udXRpbHMucm91dGUgaW1wb3J0IEJhc2VUZXN0R2VuZXJhdG9yCiBm cm9tIHBnYWRtaW4udXRpbHMgaW1wb3J0IHNlcnZlcl91dGlscyBhcyBzZXJ2ZXJfdXRpbHMKK2Zy b20gcmVncmVzc2lvbiBpbXBvcnQgcGFyZW50X25vZGVfZGljdAogaW1wb3J0IHNpbXBsZWpzb24g YXMganNvbgogCiAKQEAgLTIxLDQyICsyMiwzNiBAQCBjbGFzcyBEYXNoYm9hcmRHcmFwaHNUZXN0 Q2FzZShCYXNlVGVzdEdlbmVyYXRvcik6CiAKICAgICBzY2VuYXJpb3MgPSBbKAogICAgICAgICAn VGVzdENhc2UgZm9yIHNlc3Npb25fc3RhdHMgZ3JhcGgnLCBkaWN0KAotICAgICAgICAgICAgc2lk PTEsCiAgICAgICAgICAgICBkaWQ9LTEsCiAgICAgICAgICAgICBjaGFydF9kYXRhPXsKICAgICAg ICAgICAgICAgICAnc2Vzc2lvbl9zdGF0cyc6IFsnVG90YWwnLCAnQWN0aXZlJywgJ0lkbGUnXSwK ICAgICAgICAgICAgIH0KICAgICAgICAgKSksICgKICAgICAgICAgJ1Rlc3RDYXNlIGZvciB0cHNf c3RhdHMgZ3JhcGgnLCBkaWN0KAotICAgICAgICAgICAgc2lkPTEsCiAgICAgICAgICAgICBkaWQ9 LTEsCiAgICAgICAgICAgICBjaGFydF9kYXRhPXsKICAgICAgICAgICAgICAgICAndHBzX3N0YXRz JzogWydUcmFuc2FjdGlvbnMnLCAnQ29tbWl0cycsICdSb2xsYmFja3MnXSwKICAgICAgICAgICAg IH0KICAgICAgICAgKSksICgKICAgICAgICAgJ1Rlc3RDYXNlIGZvciB0aV9zdGF0cyBncmFwaCcs IGRpY3QoCi0gICAgICAgICAgICBzaWQ9MSwKICAgICAgICAgICAgIGRpZD0tMSwKICAgICAgICAg ICAgIGNoYXJ0X2RhdGE9ewogICAgICAgICAgICAgICAgICd0aV9zdGF0cyc6IFsnSW5zZXJ0cycs ICdVcGRhdGVzJywgJ0RlbGV0ZXMnXSwKICAgICAgICAgICAgIH0KICAgICAgICAgKSksICgKICAg ICAgICAgJ1Rlc3RDYXNlIGZvciB0b19zdGF0cyBncmFwaCcsIGRpY3QoCi0gICAgICAgICAgICBz aWQ9MSwKICAgICAgICAgICAgIGRpZD0tMSwKICAgICAgICAgICAgIGNoYXJ0X2RhdGE9ewogICAg ICAgICAgICAgICAgICd0b19zdGF0cyc6IFsnRmV0Y2hlZCcsICdSZXR1cm5lZCddLAogICAgICAg ICAgICAgfQogICAgICAgICApKSwgKAogICAgICAgICAnVGVzdENhc2UgZm9yIGJpb19zdGF0cyBn cmFwaCcsIGRpY3QoCi0gICAgICAgICAgICBzaWQ9MSwKICAgICAgICAgICAgIGRpZD0tMSwKICAg ICAgICAgICAgIGNoYXJ0X2RhdGE9ewogICAgICAgICAgICAgICAgICdiaW9fc3RhdHMnOiBbJ1Jl YWRzJywgJ0hpdHMnXSwKICAgICAgICAgICAgIH0KICAgICAgICAgKSksICgKICAgICAgICAgJ1Rl c3RDYXNlIGZvciB0d28gZ3JhcGhzJywgZGljdCgKLSAgICAgICAgICAgIHNpZD0xLAogICAgICAg ICAgICAgZGlkPS0xLAogICAgICAgICAgICAgY2hhcnRfZGF0YT17CiAgICAgICAgICAgICAgICAg J3Nlc3Npb25fc3RhdHMnOiBbJ1RvdGFsJywgJ0FjdGl2ZScsICdJZGxlJ10sCkBAIC02NCw3ICs1 OSw2IEBAIGNsYXNzIERhc2hib2FyZEdyYXBoc1Rlc3RDYXNlKEJhc2VUZXN0R2VuZXJhdG9yKToK ICAgICAgICAgICAgIH0KICAgICAgICAgKSksICgKICAgICAgICAgJ1Rlc3RDYXNlIGZvciBmaXZl IGdyYXBocycsIGRpY3QoCi0gICAgICAgICAgICBzaWQ9MSwKICAgICAgICAgICAgIGRpZD0tMSwK ICAgICAgICAgICAgIGNoYXJ0X2RhdGE9ewogICAgICAgICAgICAgICAgICdzZXNzaW9uX3N0YXRz JzogWydUb3RhbCcsICdBY3RpdmUnLCAnSWRsZSddLApAQCAtNzUsNyArNjksNiBAQCBjbGFzcyBE YXNoYm9hcmRHcmFwaHNUZXN0Q2FzZShCYXNlVGVzdEdlbmVyYXRvcik6CiAgICAgICAgICAgICB9 CiAgICAgICAgICkpLCAoCiAgICAgICAgICdUZXN0Q2FzZSBmb3Igbm8gZ3JhcGgnLCBkaWN0KAot ICAgICAgICAgICAgc2lkPTEsCiAgICAgICAgICAgICBkaWQ9LTEsCiAgICAgICAgICAgICBjaGFy dF9kYXRhPXt9LAogICAgICAgICApKQpAQCAtOTIsMTAgKzg1LDExIEBAIGNsYXNzIERhc2hib2Fy ZEdyYXBoc1Rlc3RDYXNlKEJhc2VUZXN0R2VuZXJhdG9yKToKICAgICAgICAgcmV0dXJuIGJhc2Vf dXJsCiAKICAgICBkZWYgcnVuVGVzdChzZWxmKToKLSAgICAgICAgc2VydmVyX3Jlc3BvbnNlID0g c2VydmVyX3V0aWxzLmNvbm5lY3Rfc2VydmVyKHNlbGYsIHNlbGYuc2lkKQorICAgICAgICBzZWxm LnNlcnZlcl9pZCA9IHBhcmVudF9ub2RlX2RpY3RbInNlcnZlciJdWy0xXVsic2VydmVyX2lkIl0K KyAgICAgICAgc2VydmVyX3Jlc3BvbnNlID0gc2VydmVyX3V0aWxzLmNvbm5lY3Rfc2VydmVyKHNl bGYsIHNlbGYuc2VydmVyX2lkKQogICAgICAgICBpZiBzZXJ2ZXJfcmVzcG9uc2VbImluZm8iXSA9 PSAiU2VydmVyIGNvbm5lY3RlZC4iOgogCi0gICAgICAgICAgICB1cmwgPSBzZWxmLmdldFN0YXRz VXJsKHNlbGYuc2lkLCBzZWxmLmRpZCwKKyAgICAgICAgICAgIHVybCA9IHNlbGYuZ2V0U3RhdHNV cmwoc2VsZi5zZXJ2ZXJfaWQsIHNlbGYuZGlkLAogICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAiLCIuam9pbihzZWxmLmNoYXJ0X2RhdGEua2V5cygpKSkKICAgICAgICAgICAgIHJl c3BvbnNlID0gc2VsZi50ZXN0ZXIuZ2V0KHVybCkKICAgICAgICAgICAgIHNlbGYuYXNzZXJ0RXF1 YWxzKHJlc3BvbnNlLnN0YXR1c19jb2RlLCAyMDApCg== --0000000000006a41e605810f3746--