I want to check time speed when inserting with Entity action
I want to check time speed when inserting with advanced SQL
You can make a logging with data included datetime right before execution and instantly after execution and It will be the closest to accurate.
Hi @Dilmi Amar ,
We can use this simple step for achieve this,
1.Create Local Variables: StartTime(DateTime), EndTime(DateTime), TotalTime (Integer=>milliseconds ), RecordCount(Integer=>number of inserted records ), Speed(Decimal =>records per second )
2.Before Insert Block: StartTime = CurrDateTime()
3.Perform Insert (inside loop or Advanced SQL)
4.After Insert Block:
EndTime = CurrDateTime()
TotalTime = DateDiffMilliseconds(StartTime, EndTime)
Speed = RecordCount * 1000 / TotalTime
Now we have output:
TotalTime: how long it took (in ms)
Speed: how many records per second were inserted
Thanks
Hi @KUNDAN CHAUHAN
why use *1000
Icanot found DateDiffMilliseconds
is it equal to Diffseconds()
1.why use *1000 => just for convert milliseconds into second for "records per second" 2.I cannot found DateDiffMilliseconds : no worry just use "DiffSeconds", then output result in second if you want result in milliseconds then multiply by 1000
Use this:
TotalTime = DiffSeconds(StartTime, EndTime) - Output result in second
Speed = RecordCount / TotalTime - Output result in record per second
@KUNDAN CHAUHAN
Error is appearing.
Can you check it
@Dilmi Amar ,
In which step Error is appearing or any error log.
This error appear
can you please elaborate your use case here?
If you would like to compare the speed then against how many records?
Do you have any expected time frame?
Have you faced any issue in past with the respect to these 2 approach entity action or advance sql?
According to Outsystems best practise you should always go for Advance SQL for bulk operation.
https://success.outsystems.com/documentation/11/building_apps/data_management/data_operations/best_practices_for_fetching_data/
regards,
Manish Jawla