75
Views
3
Comments
Get Execution time of a Server Action/ Client Action in Generic way

We are migrating our application from .NET MVC to OutSystems. In .NET we have generic audit method, it is measuring the method execution time based on build-in OnActionExecuting, OnActionExecuted method. It add logs such UserId, datetime, execution time.  Only call  this "LogAction"  & it will calculate the execution time & log after execution done. 


Now we was trying to build similar approach on OS 11. One approach is use local variable, initialize at beginning of the action then at the end calculate execution time which is not generic. Don't refer service center, as it's not suitable for our scenario. We have portal (Dashboard) from where management do analysis, auditing, security inspection based on this log. 

Is there any way to achieve this?

Audit.PNG
2020-11-30 04-40-12
Mithun Rathod

Hi Muhammad,

As per my knowledge, we do not have any action available. If you want, you can do it by java script.


//call the execution action

var startTime = Date.now();


//Call your action

$actions.actionname();


var endTime= Date.now();

var Total  = endTime - startTime;


console.log(elapsedTime+'ms');




2021-01-28 10-02-59
Muhammad Mahmudul Hasan

Hi Mithun,

Rather than using JavaScript it's better to use local variable due to maintainability. But this will not bring any advantage as for every action you have to calculate it. 


I want some generic approach to calculate execution time just like .NET can.  

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.