Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
9f0e3601
Commit
9f0e3601
authored
8 years ago
by
Sree Kuchibhotla
Browse files
Options
Downloads
Patches
Plain Diff
Some debug statements and reformatting
parent
aecac88e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tools/gcp/stress_test/stress_test_utils.py
+24
-11
24 additions, 11 deletions
tools/gcp/stress_test/stress_test_utils.py
tools/run_tests/stress_test/run_on_gke.py
+2
-0
2 additions, 0 deletions
tools/run_tests/stress_test/run_on_gke.py
with
26 additions
and
11 deletions
tools/gcp/stress_test/stress_test_utils.py
+
24
−
11
View file @
9f0e3601
...
...
@@ -107,12 +107,22 @@ class BigQueryHelper:
query
=
(
'
SELECT event_type FROM %s.%s WHERE run_id =
\'
%s
\'
AND
'
'
event_type=
"
%s
"'
)
%
(
self
.
dataset_id
,
self
.
summary_table_id
,
self
.
run_id
,
EventType
.
FAILURE
)
query_job
=
bq_utils
.
sync_query_job
(
self
.
bq
,
self
.
project_id
,
query
)
page
=
self
.
bq
.
jobs
().
getQueryResults
(
**
query_job
[
'
jobReference
'
]).
execute
(
num_retries
=
num_query_retries
)
num_failures
=
int
(
page
[
'
totalRows
'
])
print
'
num rows:
'
,
num_failures
return
num_failures
>
0
try
:
query_job
=
bq_utils
.
sync_query_job
(
self
.
bq
,
self
.
project_id
,
query
)
page
=
self
.
bq
.
jobs
().
getQueryResults
(
**
query_job
[
'
jobReference
'
]).
execute
(
num_retries
=
num_query_retries
)
num_failures
=
int
(
page
[
'
totalRows
'
])
print
'
num rows:
'
,
num_failures
return
num_failures
>
0
# TODO (sreek): Cleanup the following lines once we have a better idea of
# why we sometimes get KeyError exceptions in long running test cases
except
KeyError
:
print
'
KeyError in check_if_any_tests_failed()
'
print
'
Query:
'
,
query
print
'
Query result page:
'
,
page
except
:
print
'
Exception in check_if_any_tests_failed(). Info:
'
,
sys
.
exc_info
()
print
'
Query:
'
,
query
def
print_summary_records
(
self
,
num_query_retries
=
3
):
line
=
'
-
'
*
120
...
...
@@ -126,8 +136,9 @@ class BigQueryHelper:
self
.
dataset_id
,
self
.
summary_table_id
,
self
.
run_id
)
query_job
=
bq_utils
.
sync_query_job
(
self
.
bq
,
self
.
project_id
,
query
)
print
'
{:<25} {:<12} {:<12} {:<30} {}
'
.
format
(
'
Pod name
'
,
'
Image type
'
,
'
Event type
'
,
'
Date
'
,
'
Details
'
)
print
'
{:<25} {:<12} {:<12} {:<30} {}
'
.
format
(
'
Pod name
'
,
'
Image type
'
,
'
Event type
'
,
'
Date
'
,
'
Details
'
)
print
line
page_token
=
None
while
True
:
...
...
@@ -136,9 +147,11 @@ class BigQueryHelper:
**
query_job
[
'
jobReference
'
]).
execute
(
num_retries
=
num_query_retries
)
rows
=
page
.
get
(
'
rows
'
,
[])
for
row
in
rows
:
print
'
{:<25} {:<12} {:<12} {:<30} {}
'
.
format
(
row
[
'
f
'
][
0
][
'
v
'
],
row
[
'
f
'
][
1
][
'
v
'
],
row
[
'
f
'
][
2
][
'
v
'
],
row
[
'
f
'
][
3
][
'
v
'
],
row
[
'
f
'
][
4
][
'
v
'
])
print
'
{:<25} {:<12} {:<12} {:<30} {}
'
.
format
(
row
[
'
f
'
][
0
][
'
v
'
],
row
[
'
f
'
][
1
][
'
v
'
],
row
[
'
f
'
][
2
][
'
v
'
],
row
[
'
f
'
][
3
][
'
v
'
],
row
[
'
f
'
][
4
][
'
v
'
])
page_token
=
page
.
get
(
'
pageToken
'
)
if
not
page_token
:
break
...
...
This diff is collapsed.
Click to expand it.
tools/run_tests/stress_test/run_on_gke.py
+
2
−
0
View file @
9f0e3601
...
...
@@ -530,6 +530,8 @@ def run_tests(config):
# run id. This is useful in debugging when looking at records in Biq query)
run_id
=
datetime
.
datetime
.
now
().
strftime
(
'
%Y_%m_%d_%H_%M_%S
'
)
dataset_id
=
'
%s_%s
'
%
(
config
.
global_settings
.
dataset_id_prefix
,
run_id
)
print
'
Run id:
'
,
run_id
print
'
Dataset id:
'
,
dataset_id
bq_helper
=
BigQueryHelper
(
run_id
,
''
,
''
,
config
.
global_settings
.
gcp_project_id
,
dataset_id
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment