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 1gqb9Q-0002Yh-EK for pgadmin-hackers@arkaria.postgresql.org; Mon, 04 Feb 2019 10:06:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gqb9P-0007do-5J for pgadmin-hackers@arkaria.postgresql.org; Mon, 04 Feb 2019 10:06:51 +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 1gqb9O-0007dh-Uc for pgadmin-hackers@lists.postgresql.org; Mon, 04 Feb 2019 10:06:51 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gqb9M-0006K3-EK for pgadmin-hackers@postgresql.org; Mon, 04 Feb 2019 10:06:50 +0000 Received: by mail-wr1-x444.google.com with SMTP id q18so13655724wrx.9 for ; Mon, 04 Feb 2019 02:06:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uzprLrrCHFE2uM6IqG3QwctBYlKcMYSMoxjuySLoOD4=; b=0ARsRxWTPGOM1MDYgrmJidic8O3Yi7q5ET5B6ZVXFmmJ1mWQ/nC4v1OiQH4rjeYqZf UdwPn6XCTHexzHR5u5hvgni73+vrvIcaDjwQEAfP4liJKMrksovutz/GC3HUzCSf3MPd KPwJlrlekrmmzVMWb6LJ4R7lHNpBd8hqWkMdjQ4XBayRgESe+zJExuQg8E+zCamsKlbp f6LryVvg5WQqStqV0dXa32GIM0ziDGu0oO+T+n9SLFvY9jsynV6m5Pcix/vLB/+AzGL9 9p3E0l1Mx02gtS2luSeIy0SKEvGkzfhfUTNdk2REP+EFu4x6/+ssXJNBhxKAXH4l0VyU RPLQ== 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=uzprLrrCHFE2uM6IqG3QwctBYlKcMYSMoxjuySLoOD4=; b=GzexBP8A+1St/UNtYLeup/uZ+nt1YSU3kqKMkCbgOhwBl9GOfpxMND/sgRfzE9nsGy V+6soe0FjBKY3ZxOPGbdGcWAxEWpvAEJkzDoi/P7BIQEV4kMRk0G9mZv3TeqPAmKNj62 z8H1F6shJLX3l5GUGsuTlNCqvoS+yfS9U5AVeBVLaVvRHsfi1vHiz5yJHn0kXIlGydfX +pEVA6JK+knBeo3ZczwgBCyEURB42Pp7GVhYzrK3/GuRXQe8V8J0G4CaYkOjRHgySdCi SkwkIO2Suwpj2ZMGVq+vkE29MIolx+cSB0Pj1lZtK8WZi11SDT9PoXO6xvsxCESqUonS 9UvQ== X-Gm-Message-State: AHQUAuZbnJkSKgYiAUGyscT8iiyOGdHp5EDNL2nZ2ApK1ePhOXk1nOav P9alELhDYCyIrXc3ebz9RUy2uRx/nAE7gIB6oZHvHQ== X-Google-Smtp-Source: AHgI3IaqJKuybnWSj+6F4d3S20WmrqUGekXu2lRjNnBLRqu8O9zB9+sakSdn9NE3ncSSqJiJtbj/zrszNZjXT9g+nYE= X-Received: by 2002:adf:e589:: with SMTP id l9mr10893067wrm.312.1549274807646; Mon, 04 Feb 2019 02:06:47 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dave Page Date: Mon, 4 Feb 2019 10:06:36 +0000 Message-ID: Subject: Re: [pgAdmin4][RM3941] Dashboard graphs needs optimizations To: Aditya Toshniwal Cc: Khushboo Vashi , Akshay Joshi , pgadmin-hackers Content-Type: multipart/alternative; boundary="00000000000091d9f805810ea643" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --00000000000091d9f805810ea643 Content-Type: text/plain; charset="UTF-8" Hi Do we also give up waiting for the original response? 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 --00000000000091d9f805810ea643 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

Do we also give up waitin= g for the original response?

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

Attached is the updated p= atch. The poller will wait 3 times the normal interval before sending new r= equest if the previous request is pending. After that, it will send the aja= x.

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&#= 39;t think the problem Khushboo notes is really a problem. Waiting for a re= sponse 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. Ma= ybe the timeout should be something like 3x the normal interval?

On Mo= n, Feb 4, 2019 at 9:02 AM Khushboo Vashi <khushboo.vashi@enterprisedb.com&= gt; 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 th= e AJAX request.
So, in this case at a time only one request is be= ing sent to the server.

@ Dave/Ashesh, if you thin= k this is okay then we can commit the patch.

Thank= s,
Khushboo

On Mon, Feb 4, 2019 at 10:45 AM Akshay Joshi <= ;akshay.= joshi@enterprisedb.com> wrote:
Hi Khushboo

Can y= ou please review it.

On Fri, Feb 1, 2019 at 7:04 PM Aditya Toshniwal &= lt;a= ditya.toshniwal@enterprisedb.com> wrote:
Hi Hackers,

Attached i= s 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 greatest common divisor of a= ll the refresh rates. Chart names which will be eligible for refresh will b= e sent with the ajax. If none are eligible, no ajax will be fired.
3) In the backend, query is gene= rated in such a way that data for all the requested chart names will be fet= ched in one hit to the database.
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
Sr. Software Architect


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


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

Ent= erpriseDB UK: htt= p://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"


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

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL = Company
--00000000000091d9f805810ea643--