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

Enable advanced monitoring for SQLServer & Postgres. #300

Merged
merged 87 commits into from
May 13, 2024

Conversation

anjagruenheid
Copy link
Contributor

This PR introduces advanced monitoring (per query and system stats) for SQL Server and Postgres. Anyone currently using monitoring will not be impacted as advanced monitoring will need to be enabled with a new CL option (mt=advanced).

In essence, this code addition allows users to run queries against system tables (SQL Server) or plugins (Postgres) which allows us to extract system and query usage statistics while benchmarking (query plans, query text, pattern execution counts, cache hits etc.).

@bpkroth bpkroth self-assigned this Apr 18, 2023
src/main/java/com/oltpbenchmark/util/MonitorInfo.java Outdated Show resolved Hide resolved
src/main/java/com/oltpbenchmark/ThreadBench.java Outdated Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

Possibly this file could use some unit tests on the expected file rotation behavior and whatnot.
Could also mark it as future work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure I understand this comment. There's no unit tests right now, writing to file is tested as part of the pipeline but the content is not checked currently.

Copy link
Collaborator

Choose a reason for hiding this comment

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

End to end test works for me too.

src/main/resources/benchmarks/tpch/dialect-postgres.xml Outdated Show resolved Hide resolved
@bpkroth bpkroth linked an issue Dec 14, 2023 that may be closed by this pull request
@bpkroth
Copy link
Collaborator

bpkroth commented Dec 20, 2023

@ranaalotaibiMS here's the PR I was mentioning. Could potentially extend this to optionally support plan capture as well.

@@ -423,13 +423,19 @@ jobs:
- name: Run benchmark
# Note: user/pass should match those used in sample configs.
run: |
java -jar benchbase.jar -b ${{matrix.benchmark}} -c config/sqlserver/sample_${{matrix.benchmark}}_config.xml --create=true --load=true --execute=true --json-histograms results/histograms.json
java -jar benchbase.jar -b ${{matrix.benchmark}} -c config/sqlserver/sample_${{matrix.benchmark}}_config.xml -im 1000 -mt advanced --create=true --load=true --execute=true --json-histograms results/histograms.json
Copy link
Collaborator

Choose a reason for hiding this comment

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

Extend to postgres as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Postgres needs a plugin installed before this works, is that even possible?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It should be. Can you point me at the extension we need? Maybe include it in some documentation with the PR too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had added a reference in the README that's in the monitoring folder. This is the name: pg_stat_statements
Let me know if/how enabling it is possible and I'll add the appropriate tests.

Copy link
Collaborator

Choose a reason for hiding this comment

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

#510 should handle part of this, and I posted a partial PR against your branch to enable the others:
anjagruenheid#3

bpkroth added a commit that referenced this pull request May 13, 2024
… CI pipeline (#510)

For testing support in #300 

Note, do to lack of support for adjusting CMD args in service container
launching (actions/runner#2139), we basically
have to manage starting the container via `docker compose` ourselves.

Luckily there are scripts for that already, and this way the CI
environment should match the local dev experience as well.
@bpkroth bpkroth merged commit 1aae257 into cmu-db:main May 13, 2024
130 checks passed
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.

Add SqlServerCollector for metrics
2 participants