Re: Pgadmin4 System Stats Extension Design

From: Aditya Toshniwal <aditya(dot)toshniwal(at)enterprisedb(dot)com>
To: Sahil Harpal <sahilharpal1234(at)gmail(dot)com>
Cc: Khushboo Vashi <khushboo(dot)vashi(at)enterprisedb(dot)com>, pgadmin-hackers(at)postgresql(dot)org, Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>, Dave Page <dpage(at)pgadmin(dot)org>, Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
Subject: Re: Pgadmin4 System Stats Extension Design
Date: 2023-08-07 05:30:39
Message-ID: CAM9w-_=KM9+onud=Co54voWNZXymOzzCkmMxfCjkU_-sNOOViQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi Sahil,

On Sun, Aug 6, 2023 at 1:21 PM Sahil Harpal <sahilharpal1234(at)gmail(dot)com>
wrote:

> Hi Aditya,
> On Thu, 3 Aug 2023 at 09:32, Aditya Toshniwal <
> aditya(dot)toshniwal(at)enterprisedb(dot)com> wrote
>
>> Because it is the default behaviour of streaming. You can add a prop
>> reverse=true to StreamingChart and change the code ret.reverse(); based
>> 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 means
> 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 values,
> 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=true flag. In your case, simply
reverse, not need of 75 points.
Array.from(new Array(xRange).keys()),
...(data.datasets?.map((d)=>{
let ret = [...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 of
>> Tables collection node.
>>
> Sure I'll do this!
>

--
Thanks,
Aditya Toshniwal
pgAdmin Hacker | Sr. Software Architect | *enterprisedb.com*
<https://www.enterprisedb.com/>
"Don't Complain about Heat, Plant a TREE"

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Pravesh Sharma 2023-08-07 05:50:19 [pgadmin-org/pgadmin4] 27c7ea: Added all like options while creating a table. #6377
Previous Message Sahil Harpal 2023-08-06 07:51:26 Re: Pgadmin4 System Stats Extension Design