Skip to content

Commit

Permalink
ci: perf test results will be stored as CircleCI artifacts only
Browse files Browse the repository at this point in the history
  • Loading branch information
mackrorysd committed Nov 20, 2024
1 parent d189416 commit 0a3b290
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 108 deletions.
36 changes: 0 additions & 36 deletions performance/daist/daist/models/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,42 +31,6 @@ def get_filename(self, tags: Optional[Iterable[str]] = None,
fmt: Format.type_ = Format.TXT) -> Path:
return super().get_filename(fmt, tags=tags)

def upload(self):
conn = psycopg2.connect(f'dbname={self.DB_NAME} '
f'user={environment.perf_result_db_user} '
f'password={environment.secrets.perf_result_db_pass} '
f'host={environment.perf_result_db_host}')

for run_row in self._perf_test_runs_table:
with conn.cursor() as cursor:
query = sql.SQL(f'INSERT INTO {self.Table.PERF_TEST_RUNS} (commit, branch) '
'VALUES ({commit}, {branch}) '
'RETURNING id;').format(
commit=sql.Literal(run_row.commit),
branch=sql.Literal(run_row.branch))
cursor.execute(query)
run_id = cursor.fetchone()[0]

for row in self._perf_tests_table:
query = sql.SQL(
f'INSERT INTO {self.Table.PERF_TESTS} '
'(test_name, run_id, avg, min, med, max, p90, p95, passes, fails) '
'VALUES ({test_name}, {run_id}, {avg}, {min}, {med}, {max}, {p90}, '
'{p95}, {passes}, {fails});').format(
test_name=sql.Literal(row.test_name),
run_id=sql.Literal(run_id),
avg=sql.Literal(row.avg),
min=sql.Literal(row.min),
med=sql.Literal(row.med),
max=sql.Literal(row.max),
p90=sql.Literal(row.p90),
p95=sql.Literal(row.p95),
passes=sql.Literal(row.passes),
fails=sql.Literal(row.fails),
)
cursor.execute(query)
conn.commit()

def __str__(self):
return '\n'.join([f'{self._perf_test_runs_table.get_qualname()}:',
str(self._perf_test_runs_table),
Expand Down
7 changes: 0 additions & 7 deletions performance/daist/daist/rest_api/test_locust.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,6 @@ def _save_to_results(self, locust_stats: List[StatsEntry],
file_meta = FileMeta()
file_meta.test_id = self.id()
session.result.add_obj(perf_tests_run, perf_tests_run.get_filename(tags=(tag,)), file_meta)
if environment.secrets.perf_result_db_pass is not None:
logger.info(f'Uploading {self.id()} results.')
try:
perf_tests_run.upload()
except Exception as err:
logger.exception(f'Failed to upload {self.id()} results.')
raise err

def test(self):
self._runner.start(self._USERS, spawn_rate=self._USERS)
Expand Down
65 changes: 0 additions & 65 deletions performance/daist/uts/models/test_db.py

This file was deleted.

0 comments on commit 0a3b290

Please sign in to comment.