Skip to content

Commit eeef28c

Browse files
ScottLinnncopybara-github
authored andcommitted
add a new flag for Spanner tests
PiperOrigin-RevId: 829592447
1 parent 57dfb58 commit eeef28c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

perfkitbenchmarker/providers/gcp/gcp_spanner.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,8 @@ def GetResourceMetadata(self) -> Dict[Any, Any]:
576576
})
577577
else:
578578
metadata['gcp_spanner_node_count'] = self.nodes
579+
if _MAX_COMMIT_DELAY.value:
580+
metadata['gcp_spanner_max_commit_delay'] = _MAX_COMMIT_DELAY.value
579581
return metadata
580582

581583
def GetAverageCpuUsage(

perfkitbenchmarker/sql_engine_utils.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,15 @@ def Connect(
378378
sessions_arg = (
379379
f'-r "minSessions={sessions};'
380380
f'maxSessions={_PGADAPTER_MAX_SESSIONS};'
381-
f'numChannels={int(_PGADAPTER_MAX_SESSIONS/100)}"'
381+
f'numChannels={int(_PGADAPTER_MAX_SESSIONS/100)}'
382382
)
383+
if FLAGS.cloud_spanner_max_commit_delay is not None:
384+
sessions_arg = (
385+
sessions_arg
386+
+ f';maxCommitDelay={FLAGS.cloud_spanner_max_commit_delay}'
387+
)
388+
sessions_arg = sessions_arg + '"'
389+
383390
properties = self.connection_properties
384391
database_name = database_name or properties.database_name
385392
command = (

0 commit comments

Comments
 (0)