Performance logs

Answered
Massimo asked on September 5, 2022

Hi Team,
I would develop some performance logs in a custom datasource pivot, the use cases are:

  • the user expand an aggregate header on pivot
  • the user apply a filter on pivot
  • the user apply a fields modification
  • the user reload data (updateData method)

What is the best aproach for develop it ?
Thanks in advanced 
 
Massimo

9 answers

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster September 6, 2022

Hello, Massimo!
 
Thank you for your question.
 
Could you please provide us with more details about the processes you want to measure the performance of?
With this information, we could give you more case-specific suggestions.
 
From our perspective, server-side performance measuring is worth more attention. The main reason is that performance on the client side always depends on the capabilities of the client's machine and on the network connection quality as well.
 
Looking forward to hearing from you.
 
Regards,
Solomiia

Public
Massimo September 7, 2022

Hello Solomiia,
it would be nice to have the time of those usecases, for example : 

  1. the user apply filter -> in chrome console we print the starting time 
  2. flexmonster server request : fields, member and select (if necessary) -> in chrome console we print the time of those requests
  3. finish ui render ->  in chrome console we print the end time 

i hope i'm making myself clear
regards, 
Massimo

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster September 7, 2022

Hello, Massimo!
 
Thank you for the details about your use case.
 
Kindly note that you can achieve the desired behavior using our runningquery and querycomplete events. 
The algorithm is the following:
1. Start the timer when runningquery event is triggered.
2.(optional) Output your request to the console using customizeAPIRequest() API call: https://www.flexmonster.com/api/customizeapirequest/.
3. Stop the timer on querycomplete.
 
We have prepared a JSFiddle example for illustration: https://jsfiddle.net/flexmonster/n3sgmb5v/.
You can filter/expand/etc. the data and open the Dev Console(press F12) to check out the tracked time.
 
Hope you will find this answer helpful.
 
Kind regards,
Solomiia

Public
Massimo September 8, 2022

Hi Solomiia,
i've some doubts about your reply, the events aftergriddraw and beforegriddraw are the events about grid rendering but in the example apparently the beforegriddraw and aftergriddraw are triggered after the querycomplete, so we don't estimate that time.
How can i calcolate the logs with customizeAPIRequest()? CustomizeAPIRequest is usefull only as "start request event" but we don't have any "end request event".
Thanks in advance 
Massimo  

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster September 8, 2022

Hello, Massimo!
 
Thank you for your response.
 
It is true that we don't track the time for grid rendering in our example. This was done because the time for rendering is very insignificant in comparison to the time spent communicating with the server, so we think it is okay to ignore it.

In case you want to track grid rendering, here is the typical events flow:

  1. customizeAPIRequest() is executed firs.
  2. Then, the runningQuery event is triggered.
  3. After we've got the response from the server, it could be either queryerror or querycomplete.
  4. After that, the beforegriddraw is triggered.
  5. After the grid is rendered, the aftergriddraw is called. Please note that it could be called more than once for each grid rendering.

You can follow this flow to include time for grid rendering in your performance measuring, but our suggestion would be to skip measuring the time taken for rendering.
 
Hope it helps.
Looking forward to your response.
 
Kind regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster September 20, 2022

Hello, Massimo!

Hope you are doing well.

Our team is wondering if you had a chance to try the suggested approach to measure the performance.
Could you please let us know if it was helpful?

Looking forward to hearing from you.

Regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster September 27, 2022

Hello, Massimo!

Hope you are having a great week.

Just checking in to ask if the suggested approach was helpful in measuring the performance.

Looking forward to your response.

Kind regards,
Solomiia

Public
Massimo October 3, 2022

Hi Solomiia ,
I confirm the logs work !
Kind regards,
Massimo

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster October 3, 2022

Hello, Massimo!

Thank you for your feedback.

We are glad to hear that the suggested approach works for you.

You are welcome to contact us in case of any other questions.

Best regards,
Solomiia

Please login or Register to Submit Answer