Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
DBMON-2051: Adding a deadlock metric to MySQL databases #16904
DBMON-2051: Adding a deadlock metric to MySQL databases #16904
Changes from 28 commits
f6da4ae
f0a7bcf
402fa6f
cdf9819
89728de
af655a4
9f04c81
c87e65c
e1c2b7a
6b1eb22
0c6b230
478063b
03efd98
deeddbb
dc5693d
6c7dc2e
1492844
7441ad0
edd227c
8abc8bf
ffd08e1
5c4e7ba
49582d0
daac79f
ee10ca3
e295f28
8e89bf4
8bce957
e72f952
126881e
77d44a1
e513c14
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not include the ticket in the changelog since this is mostly for customers and they can't have access to our Jira board
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, now, I remembered in my previous company we had two separate entries one for customers and one internal with the ticket. Ok, let me remove it, thx.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to put this under
def check
after db connection is establishedintegrations-core/mysql/datadog_checks/mysql/mysql.py
Line 281 in 8bce957
We can also rename the function
_is_innodb_engine_enabled
to something like_check_innodb_engine_enabled
.In the
__init__
constructor, we can just initialize a variableself.innodb_engine_enabled = None
as None to indicate the check has not been done.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx, for renaming will do.
as for moving it to check - that was my initial idea too. But I didn't like that I had to add db as an argument to runtime_queries. Although, now, I greped the code and no one is calling this from outside of the class. I thought if it's without _ then it's public and I cant change the signature.
The other option is to modify
_check_innodb_engine_enabled
, I could've check there if self.conn is None or not, and if not open a connection there. Pls let me know which one is better or something else.What I don't like in my solution and kind of in existing one is the absence of clarity - how one can know that
_check_innodb_engine_enabled
has to be called and not _is_innodb_engine_enabled. Same for the runtime_queries property vs _runtime_queries. May be we call _runtime_queries -> _runtime_queries_cached and same for _is_innodb_engine_enabled -> _is_innodb_engine_enabled_cached. Like this it would be clear that this field might be None.