Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb452e0d

Browse files
committed
Added command execution time measurement
This will be useful to keep track of possible performance degradation when code changes.
1 parent8a25cb3 commitb452e0d

File tree

1 file changed

+5
-0
lines changed
  • testgres/plugins/pg_probackup2/pg_probackup2

1 file changed

+5
-0
lines changed

‎testgres/plugins/pg_probackup2/pg_probackup2/app.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def __init__(self, test_class: unittest.TestCase,
5656
self.verbose=init_params.verbose
5757
self.archive_compress=init_params.archive_compress
5858
self.test_class.output=None
59+
self.execution_time=None
5960

6061
defrun(self,command,gdb=False,old_binary=False,return_id=True,env=None,
6162
skip_log_directory=False,expect_error=False,use_backup_dir=True):
@@ -113,11 +114,15 @@ def run(self, command, gdb=False, old_binary=False, return_id=True, env=None,
113114
cmdline= ['gdbserver']+ ['localhost:'+str(gdb_port)]+cmdline
114115
print("pg_probackup gdb suspended, waiting gdb connection on localhost:{0}".format(gdb_port))
115116

117+
start_time=time.time()
116118
self.test_class.output=subprocess.check_output(
117119
cmdline,
118120
stderr=subprocess.STDOUT,
119121
env=env
120122
).decode('utf-8',errors='replace')
123+
end_time=time.time()
124+
self.execution_time=end_time-start_time
125+
121126
ifcommand[0]=='backup'andreturn_id:
122127
# return backup ID
123128
forlineinself.test_class.output.splitlines():

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp