Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload benchmark copy query times to benchmark server #2099

Merged
merged 9 commits into from
Sep 29, 2023

Conversation

russell-liu
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (a21e52d) 88.91% compared to head (fb666af) 89.60%.
Report is 17 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2099      +/-   ##
==========================================
+ Coverage   88.91%   89.60%   +0.68%     
==========================================
  Files         979      985       +6     
  Lines       36082    35750     -332     
==========================================
- Hits        32082    32032      -50     
+ Misses       4000     3718     -282     
Files Coverage Δ
src/include/storage/storage_info.h 100.00% <100.00%> (ø)

... and 56 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

for line in iter(process.stdout.readline, b''):
print(line.decode("utf-8"), end='')
if match:
with open(os.path.join(benchmark_copy_log_dir, match.group(1) + '_log.txt'), 'ab') as f:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should consider move this out of the for loop. You should not need to reopen the file each time.

process.stdin.close()
match = re.match('copy (.*) from', s, re.IGNORECASE)
for line in iter(process.stdout.readline, b''):
print(line.decode("utf-8"), end='')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to switch to sys.stdout.write and sys.stdout.flush to see if it solves the out of order issue

@russell-liu
Copy link
Contributor Author

Working now at: https://benchmark.kuzudb.com/run.html#2411

match = re.match('create\s+(.+?)\s+table\s+(.+?)\s*\(', s, re.IGNORECASE)
if match:
table_types[match.group(2)] = match.group(1).lower()
match = False
Copy link
Collaborator

@mewim mewim Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic is not very readable.

  1. You should run the check for create statement before subprocess.Popen. If it is a create you should simply pass the output via sys.stdout and sys.stderr redirection instead of manually get the output and print.
  2. Instead of setting match to False here you should indent line 66-75 so it is under your else. If you do this, you can also avoid the if check for your write and flush.
  3. Do not reuse your flags. Call it create_match and copy_match maybe. Reusing a flag-type variable is
    error-prone and make the code hard to understand.

Copy link
Collaborator

@mewim mewim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM now. It should be merged after another round of end-to-end test.

@russell-liu russell-liu merged commit 951a2ca into master Sep 29, 2023
10 of 11 checks passed
@russell-liu russell-liu deleted the benchmark-copy-queries branch September 29, 2023 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants