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

Adding more MySQL metrics #726

Merged
merged 2 commits into from
Jan 24, 2014
Merged

Adding more MySQL metrics #726

merged 2 commits into from
Jan 24, 2014

Conversation

skingry
Copy link
Contributor

@skingry skingry commented Nov 21, 2013

Note that the 'created_tmp_*' status vars are all counters in MySQL... so the corresponding type should be RATE and not GAUGE.

@remh
Copy link
Contributor

remh commented Jan 10, 2014

Thanks @skingry !
Is there a minimum required mysql version to get these metrics ?

@skingry
Copy link
Contributor Author

skingry commented Jan 10, 2014

I think there is, 5.5.

On Fri, Jan 10, 2014 at 5:34 PM, Remi Hakim notifications@github.comwrote:

Thanks @skingry https://github.com/skingry !
Is there a minimum required mysql version to get these metrics ?


Reply to this email directly or view it on GitHubhttps://github.com//pull/726#issuecomment-32073508
.

'Created_tmp_files': ('mysql.performance.created_tmp_files', RATE),
'Innodb_row_lock_waits': ('mysql.innodb.row_lock_waits', RATE),
'Innodb_row_lock_time': ('mysql.innodb.row_lock_time', RATE),
'Innodb_current_row_locks': ('mysql.innodb.current_row_locks', RATE),
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't that metric be a gauge instead ?

Choose a reason for hiding this comment

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

FWIW adding my 2 cents.

If you intend to add metrics like Com_select, Com_insert, Com_update and
Com_delete, you are only covering several of the primary operations of
SELECT and DML.
Technically you need to include com_insert_select, com_update_multi,
com_delete_multi, com_replace and com_replace_select.

Honestly, the correct way to calculate properly:

SELECT com_select + qcache_hits
INSERT com_insert + com_insert_select
UPDATE com_update + com_update_multi
DELETE com_delete + com_delete_multi
REPLACE com_replace + com_replace_select

On Tue, Jan 21, 2014 at 7:25 PM, Remi Hakim notifications@github.comwrote:

In checks.d/mysql.py:

 'Slow_queries': ('mysql.performance.slow_queries', RATE),
 'Questions': ('mysql.performance.questions', RATE),
 'Queries': ('mysql.performance.queries', RATE),
  • 'Com_select': ('mysql.performance.com_select', RATE),
  • 'Com_insert': ('mysql.performance.com_insert', RATE),
  • 'Com_update': ('mysql.performance.com_update', RATE),
  • 'Com_delete': ('mysql.performance.com_delete', RATE),
  • 'Innodb_mutex_spin_waits': ('mysql.innodb.mutex_spin_waits', RATE),
  • 'Innodb_mutex_spin_rounds': ('mysql.innodb.mutex_spin_rounds', RATE),
  • 'Innodb_mutex_os_waits': ('mysql.innodb.mutex_os_waits', RATE),
  • 'Created_tmp_tables': ('mysql.performance.created_tmp_tables', RATE),
  • 'Created_tmp_disk_tables': ('mysql.performance.created_tmp_disk_tables', RATE),
  • 'Created_tmp_files': ('mysql.performance.created_tmp_files', RATE),
  • 'Innodb_row_lock_waits': ('mysql.innodb.row_lock_waits', RATE),
  • 'Innodb_row_lock_time': ('mysql.innodb.row_lock_time', RATE),
  • 'Innodb_current_row_locks': ('mysql.innodb.current_row_locks', RATE),

Shouldn't that metric be a gauge instead ?


Reply to this email directly or view it on GitHubhttps://github.com//pull/726/files#r9061026
.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the input @ronaldbradford !

@skingry we should probably add the fields @ronaldbradford is talking about separately.

What do you think ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for the late reply, all of that sounds good, and yes it looks like
'innodb_current_row_locks' should be a gauge and not a counter

On Thu, Jan 23, 2014 at 4:22 PM, Remi Hakim notifications@github.comwrote:

In checks.d/mysql.py:

 'Slow_queries': ('mysql.performance.slow_queries', RATE),
 'Questions': ('mysql.performance.questions', RATE),
 'Queries': ('mysql.performance.queries', RATE),
  • 'Com_select': ('mysql.performance.com_select', RATE),
  • 'Com_insert': ('mysql.performance.com_insert', RATE),
  • 'Com_update': ('mysql.performance.com_update', RATE),
  • 'Com_delete': ('mysql.performance.com_delete', RATE),
  • 'Innodb_mutex_spin_waits': ('mysql.innodb.mutex_spin_waits', RATE),
  • 'Innodb_mutex_spin_rounds': ('mysql.innodb.mutex_spin_rounds', RATE),
  • 'Innodb_mutex_os_waits': ('mysql.innodb.mutex_os_waits', RATE),
  • 'Created_tmp_tables': ('mysql.performance.created_tmp_tables', RATE),
  • 'Created_tmp_disk_tables': ('mysql.performance.created_tmp_disk_tables', RATE),
  • 'Created_tmp_files': ('mysql.performance.created_tmp_files', RATE),
  • 'Innodb_row_lock_waits': ('mysql.innodb.row_lock_waits', RATE),
  • 'Innodb_row_lock_time': ('mysql.innodb.row_lock_time', RATE),
  • 'Innodb_current_row_locks': ('mysql.innodb.current_row_locks', RATE),

Thanks for the input @ronaldbradford https://github.com/ronaldbradford !

@skingry https://github.com/skingry we should probably add the fields
@ronaldbradford https://github.com/ronaldbradford is talking about
separately.

What do you think ?


Reply to this email directly or view it on GitHubhttps://github.com//pull/726/files#r9130361
.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

...actually on what @ronaldbradford had added, I personally would against
doing the calculations in the check... the metrics themselves should be
measured as unadulterated as possible, and then any calculations should be
performed at the presentation layer (ie. graphing)

On Thu, Jan 23, 2014 at 5:06 PM, Seth Kingry sjkingry@gmail.com wrote:

Sorry for the late reply, all of that sounds good, and yes it looks like
'innodb_current_row_locks' should be a gauge and not a counter

On Thu, Jan 23, 2014 at 4:22 PM, Remi Hakim notifications@github.comwrote:

In checks.d/mysql.py:

 'Slow_queries': ('mysql.performance.slow_queries', RATE),
 'Questions': ('mysql.performance.questions', RATE),
 'Queries': ('mysql.performance.queries', RATE),
  • 'Com_select': ('mysql.performance.com_select', RATE),
  • 'Com_insert': ('mysql.performance.com_insert', RATE),
  • 'Com_update': ('mysql.performance.com_update', RATE),
  • 'Com_delete': ('mysql.performance.com_delete', RATE),
  • 'Innodb_mutex_spin_waits': ('mysql.innodb.mutex_spin_waits', RATE),
  • 'Innodb_mutex_spin_rounds': ('mysql.innodb.mutex_spin_rounds', RATE),
  • 'Innodb_mutex_os_waits': ('mysql.innodb.mutex_os_waits', RATE),
  • 'Created_tmp_tables': ('mysql.performance.created_tmp_tables', RATE),
  • 'Created_tmp_disk_tables': ('mysql.performance.created_tmp_disk_tables', RATE),
  • 'Created_tmp_files': ('mysql.performance.created_tmp_files', RATE),
  • 'Innodb_row_lock_waits': ('mysql.innodb.row_lock_waits', RATE),
  • 'Innodb_row_lock_time': ('mysql.innodb.row_lock_time', RATE),
  • 'Innodb_current_row_locks': ('mysql.innodb.current_row_locks', RATE),

Thanks for the input @ronaldbradford https://github.com/ronaldbradford!

@skingry https://github.com/skingry we should probably add the fields
@ronaldbradford https://github.com/ronaldbradford is talking about
separately.

What do you think ?


Reply to this email directly or view it on GitHubhttps://github.com//pull/726/files#r9130361
.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep agree with that, it should be collected separately.
Could you add them in your PR please ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added!

@remh
Copy link
Contributor

remh commented Jan 23, 2014

Thanks @skingry Can you just tell me what you think about the question I asked about Innodb_current_row_locks ?

Other than that it looks good and I'm going to merge it soon.
Thanks!

@remh
Copy link
Contributor

remh commented Jan 24, 2014

Thanks!

remh added a commit that referenced this pull request Jan 24, 2014
Adding more MySQL metrics
@remh remh merged commit f6d4539 into DataDog:master Jan 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants