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 1gqbFi-0002pI-AX for pgadmin-hackers@arkaria.postgresql.org; Mon, 04 Feb 2019 10:13:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gqbFh-0005Hb-4r for pgadmin-hackers@arkaria.postgresql.org; Mon, 04 Feb 2019 10:13:21 +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 1gqbFg-0005HU-UB for pgadmin-hackers@lists.postgresql.org; Mon, 04 Feb 2019 10:13:21 +0000 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gqbFb-0006Rg-22 for pgadmin-hackers@postgresql.org; Mon, 04 Feb 2019 10:13:20 +0000 Received: by mail-qt1-x841.google.com with SMTP id k12so14711174qtf.7 for ; Mon, 04 Feb 2019 02:13:14 -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=Nn+fLXgCFccWETY/ymK/pnTpxtwinxFOR44HscmVcb0=; b=jPTMjC2bz7j78o7QPNWkCtpwjJascJKPeYd+SH22ZN9E17mDDyKM0svPt7kFTWWDn+ wUPdq7r/W92uWae9CybKXwGnrsUf872uWvFx48KVCZfhLQGl3LkkO+QeLbf610ImY//l wPxh0iof4rZ/MxX/7VogM84guatPDZbyVjxJm/wFD5eqHriCex08mGfj2Ucd6vr41vXV 0N25szjZnBSJguKq/+lu4i2JsTTzmOjal6SifUYMf+tqSyqalBswR0ZrNpewtxmTZFqh 9SRDOT7K3ybv+/m1QoMuW9p8IWtyhpArOWsexlp3AkNB/M/iXln35Y2U9ogweZPjy61h fhJA== 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=Nn+fLXgCFccWETY/ymK/pnTpxtwinxFOR44HscmVcb0=; b=t8GXsqUDTkHCjSAJy09U7ogFZu8ZAkJMvuOO15ABGBzApJ6FKB3DX+6E7kRVjZLZzt XaTcGpDPuSD9K4O6z8HukzVI/NS0myzoLGFUuSU77/r0ZO/BXT2B5ev/2b6onY6xwG0L 95LCRTVZKu8ckTghIeMduvP+Y9TgusVA0L6/3suX3vN9XVjVLwzBnzwEGh3WN3+KE+L6 b6MlPVnwTgCr+bUUzjH8LxGiYU7HdbmkruxDcrkHnsTi13la/gT0DkA6FT97qqvOev4n 7B4hmV08Cd2aqG48oEJpU2pFQGmWP0n8n/4s3mazmBMgs1sGXa0BBzlXbxFUW+cenEf3 lEJw== X-Gm-Message-State: AHQUAuZrQj1trycKctw6rfLC0ui3uxNKm0XBcaZNJphVkK/9F57IjGG7 vgYM96oto7gPZweXK7tFlDh2QgfMONZytzV4XLpPsA== X-Google-Smtp-Source: AHgI3IYCo7MShRSPCTRrt2pmruKm5aHE2iRwkIgZ0Jgt6XyoUJK8YyuvlMQLVz3qUAPGig74w7QIzjzJgq2b9GXU1/s= X-Received: by 2002:ac8:60d6:: with SMTP id i22mr887933qtm.323.1549275192938; Mon, 04 Feb 2019 02:13:12 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Akshay Joshi Date: Mon, 4 Feb 2019 15:43:01 +0530 Message-ID: Subject: Re: [pgAdmin4][RM3941] Dashboard graphs needs optimizations To: Aditya Toshniwal Cc: Dave Page , Khushboo Vashi , pgadmin-hackers Content-Type: multipart/alternative; boundary="00000000000088eb2a05810ebd3f" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --00000000000088eb2a05810ebd3f Content-Type: text/plain; charset="UTF-8" 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* --00000000000088eb2a05810ebd3f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks patch applied.

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

Attached is the upda= ted 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 th= e ajax.

Kindly review.

On Mon, Feb 4, 2019 at 3:12 PM Dave Page &= lt;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 for a response before issuing a= nother 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,<= div>
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<= /a>> wrote:
<= div dir=3D"ltr">Hi Khushboo

Can you please review it.

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 th= e previous is completed.
2) The code will check for intervals which is grea= test common divisor of all the refresh rates. Chart names which will be eli= gible 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 da= ta for all the requested chart names will be fetched in one hit to the data= base.
4) Test cases for charts rest api and javascript added.
--
Thanks and Regards,
Aditya Toshniwal
Software Engineer |=C2=A0EnterpriseDB Software Solutions |=C2= =A0Pune
"Don't Complain about Heat, Plant a tree"


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

=

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


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

Enterpr= iseDB UK: http://= www.enterprisedb.com
The Enterprise PostgreSQL Company


--
=
Thanks and Regards,
Aditya Toshniwal
Software Engineer |=C2=A0EnterpriseDB Software Sol= utions |=C2=A0Pune
"Don't Complain about Heat, Plant a tr= ee"


--
Akshay Joshi
Sr. S= oftware Architect
=

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