Toad World® Forums

Automatic updating/refresh of elapsed time value


#1

A user recently asked how Code Tester could support this functionality:

========================
I have test case that runs procedure ABC from user schema ‘XXX’.
Let’s say it finishes in 10 minutes. I need somehow to record this
result. Next time I am running the same test case connecting to
different schema (‘ZZZ’) I need to make sure execution time is
comparable to 10 minutes. How can I write a statement in “cleanup”
section that would record the result “10 min” for future references?

This is what I proposed to her: first, create an elapsed time outcome for this test case. Then put the following code into the cleanup customization section for the outcome:

DECLARE
PROCEDURE update_timing
IS
PRAGMA AUTONOMOUS_TRANSACTION;
l_rows PLS_INTEGER;
BEGIN
qu_attributes_cp.upd_onecol_pky
(colname_in => ‘INTERNAL_VALUE’
, new_value_in => TO_CHAR ( q##end_time
- q##start_time
)
, parent_guid_in => qu_result_xp.current_outcome
, usage_type_in => ‘CONTROL’
, rows_out => l_rows
);
qu_attributes_cp.upd_onecol_pky
(colname_in => ‘EXTERNAL_VALUE’
, new_value_in => TO_CHAR ( q##end_time
- q##start_time
)
, parent_guid_in => qu_result_xp.current_outcome
, usage_type_in => ‘CONTROL’
, rows_out => l_rows
);
COMMIT;
END;
BEGIN
update_timing;
END;

You will then see the expected elapsed time to be changed to the elapsed time of the last run of the program.