Skip to content

Conversation

agithomas
Copy link
Contributor

@agithomas agithomas commented Sep 8, 2023

  • Bug

What does this PR do?

The query SELECT name, physical_reads, db_block_gets, consistent_gets, 1 - (physical_reads / (db_block_gets + consistent_gets)) "Hit_Ratio" FROM V$BUFFER_POOL_STATISTICS may result in error when (db_block_gets + consistent_gets) is zero.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

How to test this PR locally

  • elastic-package build
  • elastic-package stack up -v -d --services package-registry

Related issues

Screenshots

After the change

image

PR Review Priority - High

The PR is related to an SDH

@agithomas agithomas marked this pull request as ready for review September 8, 2023 07:18
@agithomas agithomas requested a review from a team as a code owner September 8, 2023 07:18
@agithomas
Copy link
Contributor Author

Dashboard verification completed

image

@elasticmachine
Copy link

elasticmachine commented Sep 8, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-09-08T07:17:17.246+0000

  • Duration: 38 min 31 sec

Test stats 🧪

Test Results
Failed 0
Passed 26
Skipped 0
Total 26

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine
Copy link

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (1/1) 💚
Files 100.0% (1/1) 💚
Classes 100.0% (1/1) 💚
Methods 100.0% (29/29) 💚 14.444
Lines 94.318% (249/264) 👍 1.723
Conditionals 100.0% (0/0) 💚

@@ -7,7 +7,7 @@ hosts:
raw_data.enabled: true
driver: "oracle"
sql_queries:
- query: SELECT name, physical_reads, db_block_gets, consistent_gets, 1 - (physical_reads / (db_block_gets + consistent_gets)) "Hit_Ratio" FROM V$BUFFER_POOL_STATISTICS
- query: SELECT name, physical_reads, db_block_gets, consistent_gets, 1 - (physical_reads / (db_block_gets + consistent_gets)) "Hit_Ratio" FROM V$BUFFER_POOL_STATISTICS where (db_block_gets + consistent_gets) > 0
response_format: table
Copy link
Member

Choose a reason for hiding this comment

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

Having this check as a prevention mechanism is fine.
But, in a properly configured Oracle Instance, can there be a use case where this (db_block_gets + consistent_gets) is 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The same question was asked in the SDH and it is observed in a production instance of Oracle, surprisingly.

Copy link
Contributor Author

@agithomas agithomas Sep 8, 2023

Choose a reason for hiding this comment

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

Values as below are observed

select name, physical_reads from V$BUFFER_POOL_STATISTICS;
DEFAULT 413583949349
KEEP 0

Copy link
Member

Choose a reason for hiding this comment

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

Ok, then this check should be fine

Copy link
Member

@ishleenk17 ishleenk17 left a comment

Choose a reason for hiding this comment

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

Looks good!

@@ -7,7 +7,7 @@ hosts:
raw_data.enabled: true
driver: "oracle"
sql_queries:
- query: SELECT name, physical_reads, db_block_gets, consistent_gets, 1 - (physical_reads / (db_block_gets + consistent_gets)) "Hit_Ratio" FROM V$BUFFER_POOL_STATISTICS
- query: SELECT name, physical_reads, db_block_gets, consistent_gets, 1 - (physical_reads / (db_block_gets + consistent_gets)) "Hit_Ratio" FROM V$BUFFER_POOL_STATISTICS where (db_block_gets + consistent_gets) > 0
response_format: table
Copy link
Member

Choose a reason for hiding this comment

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

Ok, then this check should be fine

@agithomas agithomas merged commit b38de98 into elastic:main Sep 8, 2023
@elasticmachine
Copy link

Package oracle - 1.20.1 containing this change is available at https://epr.elastic.co/search?package=oracle

@agithomas agithomas deleted the issue-sdh-3762 branch February 12, 2025 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants