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 1gqbCf-0002eq-BR for pgadmin-hackers@arkaria.postgresql.org; Mon, 04 Feb 2019 10:10:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gqbCd-0002a8-SE for pgadmin-hackers@arkaria.postgresql.org; Mon, 04 Feb 2019 10:10:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gqbCd-0002a0-L5 for pgadmin-hackers@lists.postgresql.org; Mon, 04 Feb 2019 10:10:11 +0000 Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gqbCX-0006Le-3x for pgadmin-hackers@postgresql.org; Mon, 04 Feb 2019 10:10:10 +0000 Received: by mail-lf1-x141.google.com with SMTP id l10so9839611lfh.9 for ; Mon, 04 Feb 2019 02:10:04 -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=lBQbT83bN54aPkbxahdzSzXwzW2rI7nmMdFdeXSFBIc=; b=uffim9sH4/Gl5kKvpdnpj5j04KB+sn/y/uRs5dvshyflMmJ2hqEeg5XhibVDWRh+X/ 2MwIygQHyfzFQwENS5twCdBzutYZhSrtBpqs0tyk99qdEHb/dya/FOCVPzfcbh+0aUgq Spgdy4iRtYzApzJBg/wKeQwvzhWwXVxDmNPUb4VZ2mglRYRbz5Wj6JQSEDbtAiM95Yqd DP9+34siuRpnkCXwBe6ex0MFmQnRJUxyo0N6XXBT0nG1J8IThYbYu3v8dGhwn9OXY0dV C0Rz6LsNRNvhJWE6pRFj9AEJxGYr6uBhAc+mr07ZNZLGd2WPfSu4pQQpkCyAIBdiO36s 8AMg== 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=lBQbT83bN54aPkbxahdzSzXwzW2rI7nmMdFdeXSFBIc=; b=fY8+qBrXit8lKPi5gEFVc9V2JPMU6H0BjLjl0AdYBski/F0sC3Lq6qKxiyZVzrZOMi knAIhp4Eb1k9SvVcxAJmnYxgdhFqHaOBWRQD70fZMKuqYDhg0f1wDZN4NtX66ep61K8T xaFCTwuzhcoFINm6synA/pwQDQY3apfv3z7RkuXohDy7g6+jKHdGXIABlUGwY89dIApq VI+oo91b7wiLg9mrvzCR3Tx0Q1Sad4M3t9pzUgH8GpaemXhiB2Qyl1DhSkCqosZK0ETd 6T6qkQWSzaLob8z7hV0CzeAW3h6MFgBhmreehHVxF3cu3JH3QX5ptM98XRLQgih8Ujhi fFzw== X-Gm-Message-State: AHQUAub6l7WLdG5avcJ0sIjujCHVDHo87rotZLDs2pf4xoyEujwBb+1q tuGx+T+ILoh5dZUygeeUS5VyuD2B2wF1L8q0wJLPSw== X-Google-Smtp-Source: AHgI3IadfrnXNXWDODa7ZitnFim6UiXPoiGKbcB7pXZPr053EBYmwbl6IfCBtvpVqdG491gm/lZfiZrBUk5IQHyN398= X-Received: by 2002:a19:c4:: with SMTP id 187mr641413lfa.105.1549275003251; Mon, 04 Feb 2019 02:10:03 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Aditya Toshniwal Date: Mon, 4 Feb 2019 15:39:52 +0530 Message-ID: Subject: Re: [pgAdmin4][RM3941] Dashboard graphs needs optimizations To: Dave Page Cc: Khushboo Vashi , Akshay Joshi , pgadmin-hackers Content-Type: multipart/alternative; boundary="0000000000003a86a305810eb2f2" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --0000000000003a86a305810eb2f2 Content-Type: text/plain; charset="UTF-8" Hi Dave, On Mon, Feb 4, 2019 at 3:36 PM Dave Page wrote: > Hi > > Do we also give up waiting for the original response? > No, that will wait until AJAX request timeout. We do not cancel it explicitly. If response is received, it will be reflected. > > On Mon, Feb 4, 2019 at 9:57 AM 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" >> > > > -- > 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" --0000000000003a86a305810eb2f2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Dave,

On Mon, Feb 4, 2019 at 3:36 PM D= ave Page <dpage@pgadmin.org>= wrote:
Hi

Do we also give up waiting for th= e original response?
No, that will wait until AJAX= request timeout. We do not cancel it explicitly.=C2=A0If response is = received, it will be reflected.

On Mon, Feb 4, 2019 at 9:57 AM Aditya Toshniw= al <aditya.toshniwal@enterprisedb.com> wrote:
Hi Hackers,

Attache= d is the updated patch. The poller will wait 3 times the normal interval be= fore 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 <dpage@pgadmin.org> wrote:
I can't get to= this right now, but Akshay, can we get it in before the release?

<= /div>
I don't think the problem Khushboo notes is really a problem.= Waiting for a response before issuing another one seems sensible... as lon= g 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 int= erval?

On Mon, Feb 4, 2019 at 9:02 AM Khushboo Vashi <khushboo.vashi@ente= rprisedb.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/As= hesh, 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
<= br>
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 t= he all the charts instead of separate for every chart. The next request wil= l not hit until the previous is completed.
2) The code will check for intervals which is greatest c= ommon 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 back= end, 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 Engi= neer |=C2=A0EnterpriseDB Software Solutions |=C2=A0Pune
"Don&= #39;t Complain about Heat, Plant a tree"


--
Akshay Joshi
=
Sr. Software Arc= hitect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
<= /div>


--
Dave Page
Blog: http://pgsnake.blogspot.com
Tw= itter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Po= stgreSQL Company


--
Thanks and Regards,
Aditya Toshniwal
Software Engineer |=C2= =A0EnterpriseDB Software Solutions |=C2=A0Pune
"Don't Com= plain about Heat, Plant a tree"
<= /div>


--
Dave Page
Blog: <= a href=3D"http://pgsnake.blogspot.com" target=3D"_blank">http://pgsnake.blo= gspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.comThe Enterprise PostgreSQL Company


--
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"
--0000000000003a86a305810eb2f2--