Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qSspt-007fAp-Fn for pgadmin-hackers@arkaria.postgresql.org; Mon, 07 Aug 2023 05:31:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qSspr-006gIm-VJ for pgadmin-hackers@arkaria.postgresql.org; Mon, 07 Aug 2023 05:31:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qSspr-006gIe-KF for pgadmin-hackers@lists.postgresql.org; Mon, 07 Aug 2023 05:31:20 +0000 Received: from mail-oa1-x35.google.com ([2001:4860:4864:20::35]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qSspo-000xr2-Tc for pgadmin-hackers@postgresql.org; Mon, 07 Aug 2023 05:31:18 +0000 Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-1bb782974f4so2995449fac.3 for ; Sun, 06 Aug 2023 22:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1691386276; x=1691991076; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=YDwMsqWcJuDkunKH2H2AOF5XsBADXuI4xE5jvNSSG8k=; b=OuEWnEyZVlH86AL8IoPXKXnOIsgPFPYFn8aySMSCqB2GcWBUUAoY9j/AsXFmUITf2f TKqivnjH8uUGdoPCkxjj98lwP19CODi+qk3/Wdk75T3gtPCz9FZIbm0oD248E7Huxhhw C6rcF8X9Ec3CfCZaIDk993OHpSNYKPZXY4zvoJlsGuaAa/ibL4C8czb9H3ZHj6K7cY85 +UiofsnhE09pn1hf8++Sn1G6ra0hQ7fIR3fw2Cln0ln/HVj301MmHp1NVLYthJr1HaLQ VZX2jAGpxww4hewrMUAwCGTWqkcerncnb05FQJoDGysOGLC6QbGyvauln7wRdsgEFMRE SpIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691386276; x=1691991076; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YDwMsqWcJuDkunKH2H2AOF5XsBADXuI4xE5jvNSSG8k=; b=E97j0B7LEdSsoVWkDRaGnVHHSAbakBJSbMFdinHU5BjYc2ZDeo6rfQu3gym9O/XSJQ uHrjmIAN7Ay5cwfJQIiAcFyWV96HhsuL0rdfo6od+8vqfSXNZ42qTk1/CrYtxIWhIs3U Xnvridd0wBPYhN/aAYiiTisTQh5u8FqeoLjjMD3qrgleZdeXp3bktz3gKMcxLNRzmJYL 474x3lCq0LlTWkwUWU68oddCIL8AaDvKhLGY8SME0hzzU5p+LT7rH1Xh3vm+TeVssZkD 6Qb7/qaUkH3tFGgK4Qza0Ll61sBgoT7XjduNgukbPUnlRNg3SKdNT24v50GpuTcUDOC5 Vb/A== X-Gm-Message-State: AOJu0YwBHJMAwRc3peEzVU0WyCUC/jsuc5PtrSh28OlDSJj09HL7G5+U lS3lITKookmBf4Si2Jfos4FiSmNdkvn8Z7V1Clh7/g== X-Google-Smtp-Source: AGHT+IEFGcO9PY9mLcwXAsWjeDlBEIdoEbyoydf/YWYhLcdO/qHllCQxkYY16Q3H1S004nmxls+XVPJwmYw6+3qNJTo= X-Received: by 2002:a05:6870:a116:b0:1b7:60aa:43f1 with SMTP id m22-20020a056870a11600b001b760aa43f1mr10191966oae.11.1691386276128; Sun, 06 Aug 2023 22:31:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Aditya Toshniwal Date: Mon, 7 Aug 2023 11:00:39 +0530 Message-ID: Subject: Re: Pgadmin4 System Stats Extension Design To: Sahil Harpal Cc: Khushboo Vashi , pgadmin-hackers@postgresql.org, Ashesh Vashi , Dave Page , Akshay Joshi Content-Type: multipart/alternative; boundary="0000000000002ac2c006024e8e5e" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000002ac2c006024e8e5e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Sahil, On Sun, Aug 6, 2023 at 1:21=E2=80=AFPM Sahil Harpal wrote: > Hi Aditya, > On Thu, 3 Aug 2023 at 09:32, Aditya Toshniwal < > aditya.toshniwal@enterprisedb.com> wrote > >> Because it is the default behaviour of streaming. You can add a prop >> reverse=3Dtrue to StreamingChart and change the code ret.reverse(); base= d >> on condition. >> > So basically, you are suggesting to add one additional property to the > streaming chart, right? Based on its value, apply ret.reverse(). This mea= ns > if reverse is true, apply ret.reverse(), otherwise don't. But it is > required to reverse our data every time, otherwise, I believe the most > recent data point will be at the beginning of our plot. > I've tried one more approach here. If our data array is full, this graph > shifting won't happen. So, if we initialize our data list with null value= s, > there won't be any visible shift. What do you think about this solution? > I would suggest changing the behaviour in StreamingChart so that it can be used at other places. If you want to reverse it then you can still do it. I had achieved reverse direction with the following piece of code. Basically, creating an array of 75 points, filling it with available points and reverse. You can change it based on reverse=3Dtrue flag. In your case, simp= ly reverse, not need of 75 points. Array.from(new Array(xRange).keys()), ...(data.datasets?.map((d)=3D>{ let ret =3D [...d.data]; ret.reverse(); return ret; })??{}), > > Unrelated to this, I think instead of showing disk sizes in bytes you can >> show them in a human readable format like below used in Statistics tab o= f >> Tables collection node. >> > Sure I'll do this! > --=20 Thanks, Aditya Toshniwal pgAdmin Hacker | Sr. Software Architect | *enterprisedb.com* "Don't Complain about Heat, Plant a TREE" --0000000000002ac2c006024e8e5e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi=C2=A0Sahil,

On Sun, Aug 6, 2023 at 1:2= 1=E2=80=AFPM Sahil Harpal <= sahilharpal1234@gmail.com> wrote:
Hi Aditya,
On Thu, 3 Aug 2023 at 09:32, Aditya Toshniwal <aditya.toshniwal@enterpr= isedb.com> wrote
3D""
Because it is the default behaviour of streaming.= =C2=A0You can add a prop=C2=A0reverse=3Dtru= e=C2=A0to StreamingChart and change the code=C2=A0ret.reverse();= =C2=A0based on condition.
So b= asically, you are suggesting to add one additional property to the streamin= g chart, right? Based on its value, apply ret.reverse(). This means if reve= rse is true, apply ret.reverse(), otherwise don't. But it is required t= o reverse our data every time, otherwise, I believe the most recent data po= int will be at the beginning of our plot.
I've tried one more approa= ch here. If our data array is full, this graph shifting won't happen. S= o, if we initialize our data list with null values, there won't be any = visible shift. What do you think about this solution?
=
I would suggest changing the behaviour in StreamingChart so t= hat it can be used at other places. If you want to reverse it then you can = still do it. I had achieved reverse direction with the following piece of c= ode. Basically, creating an array of 75 points, filling it with available p= oints and reverse. You can change it based on=C2=A0reverse=3Dtrue=C2=A0flag. In your case, simply r= everse, not need of 75 points.
Array.from(new Array(xRange).keys()),
...(data.datasets?.map((d)=3D>= ;{
let = ret =3D [...d.data];
ret.reverse();
return ret;
})??{}),

Unrelated to th= is, I think instead of showing disk sizes in bytes you can show them in a h= uman readable format like below used in Statistics=C2=A0tab of Tables colle= ction node.
Sure I'll = do this!=C2=A0


--
Thanks,
Aditya Toshniwal
pgAdmin Hacker=C2=A0| Sr. Software Architect=C2=A0| enterprisedb.com