Skip to content

Commit

Permalink
Updated to handle Buffer pool size, bytes 5575016448 and individual b…
Browse files Browse the repository at this point in the history
…uffer pool info not overwriting the totals. This may only exist in percona, but the changes are backwards compat with what was existing
  • Loading branch information
David Nguyen committed Jun 19, 2013
1 parent 883b5ea commit 9b4ac97
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
4 changes: 4 additions & 0 deletions mysqld/conf.d/mysql.pyconf
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ collection_group {
name = "mysql_innodb_rows_deleted"
}

metric {
name = "mysql_innodb_buffer_pool_pages_bytes"
}

metric {
name = "mysql_innodb_buffer_pool_pages_total"
}
Expand Down
19 changes: 14 additions & 5 deletions mysqld/python_modules/DBUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def new(*idxs):

innodb_status = defaultdict(int)
innodb_status['active_transactions']
individual_buffer_pool_info = False

for line in innodb_status_raw:
istatus = line.split()
Expand Down Expand Up @@ -204,19 +205,27 @@ def new(*idxs):
innodb_status['log_bytes_flushed'] = isum(4,5)

# BUFFER POOL AND MEMORY
elif "Buffer pool size" in line:
elif "INDIVIDUAL BUFFER POOL INFO" in line:
# individual pools section. We only want to record the totals
# rather than each individual pool clobbering the totals
individual_buffer_pool_info = True

elif "Buffer pool size, bytes" in line and not individual_buffer_pool_info:
innodb_status['buffer_pool_pages_bytes'] = longish(istatus[4])

elif "Buffer pool size" in line and not individual_buffer_pool_info:
innodb_status['buffer_pool_pages_total'] = longish(istatus[3])

elif "Free buffers" in line:
elif "Free buffers" in line and not individual_buffer_pool_info:
innodb_status['buffer_pool_pages_free'] = longish(istatus[2])

elif "Database pages" in line:
elif "Database pages" in line and not individual_buffer_pool_info:
innodb_status['buffer_pool_pages_data'] = longish(istatus[2])

elif "Modified db pages" in line:
elif "Modified db pages" in line and not individual_buffer_pool_info:
innodb_status['buffer_pool_pages_dirty'] = longish(istatus[3])

elif "Pages read" in line and "ahead" not in line:
elif "Pages read" in line and "ahead" not in line and not individual_buffer_pool_info:
innodb_status['pages_read'] = longish(istatus[2])
innodb_status['pages_created'] = longish(istatus[4])
innodb_status['pages_written'] = longish(istatus[6])
Expand Down
7 changes: 7 additions & 0 deletions mysqld/python_modules/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,13 @@ def metric_init(params):
'units': 'writes',
},

innodb_buffer_pool_pages_bytes = {
'description': "The total size of buffer pool, in bytes",
'value_type':'uint',
'units': 'bytes',
'slope': 'both',
},

innodb_buffer_pool_pages_total = {
'description': "The total size of buffer pool, in pages",
'value_type':'uint',
Expand Down

0 comments on commit 9b4ac97

Please sign in to comment.