Skip to content

Commit 9b4ac97

Browse files
author
David Nguyen
committed
Updated to handle Buffer pool size, bytes 5575016448 and individual buffer pool info not overwriting the totals. This may only exist in percona, but the changes are backwards compat with what was existing
1 parent 883b5ea commit 9b4ac97

3 files changed

Lines changed: 25 additions & 5 deletions

File tree

mysqld/conf.d/mysql.pyconf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ collection_group {
181181
name = "mysql_innodb_rows_deleted"
182182
}
183183

184+
metric {
185+
name = "mysql_innodb_buffer_pool_pages_bytes"
186+
}
187+
184188
metric {
185189
name = "mysql_innodb_buffer_pool_pages_total"
186190
}

mysqld/python_modules/DBUtil.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def new(*idxs):
9292

9393
innodb_status = defaultdict(int)
9494
innodb_status['active_transactions']
95+
individual_buffer_pool_info = False
9596

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

206207
# BUFFER POOL AND MEMORY
207-
elif "Buffer pool size" in line:
208+
elif "INDIVIDUAL BUFFER POOL INFO" in line:
209+
# individual pools section. We only want to record the totals
210+
# rather than each individual pool clobbering the totals
211+
individual_buffer_pool_info = True
212+
213+
elif "Buffer pool size, bytes" in line and not individual_buffer_pool_info:
214+
innodb_status['buffer_pool_pages_bytes'] = longish(istatus[4])
215+
216+
elif "Buffer pool size" in line and not individual_buffer_pool_info:
208217
innodb_status['buffer_pool_pages_total'] = longish(istatus[3])
209218

210-
elif "Free buffers" in line:
219+
elif "Free buffers" in line and not individual_buffer_pool_info:
211220
innodb_status['buffer_pool_pages_free'] = longish(istatus[2])
212221

213-
elif "Database pages" in line:
222+
elif "Database pages" in line and not individual_buffer_pool_info:
214223
innodb_status['buffer_pool_pages_data'] = longish(istatus[2])
215224

216-
elif "Modified db pages" in line:
225+
elif "Modified db pages" in line and not individual_buffer_pool_info:
217226
innodb_status['buffer_pool_pages_dirty'] = longish(istatus[3])
218227

219-
elif "Pages read" in line and "ahead" not in line:
228+
elif "Pages read" in line and "ahead" not in line and not individual_buffer_pool_info:
220229
innodb_status['pages_read'] = longish(istatus[2])
221230
innodb_status['pages_created'] = longish(istatus[4])
222231
innodb_status['pages_written'] = longish(istatus[6])

mysqld/python_modules/mysql.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -999,6 +999,13 @@ def metric_init(params):
999999
'units': 'writes',
10001000
},
10011001

1002+
innodb_buffer_pool_pages_bytes = {
1003+
'description': "The total size of buffer pool, in bytes",
1004+
'value_type':'uint',
1005+
'units': 'bytes',
1006+
'slope': 'both',
1007+
},
1008+
10021009
innodb_buffer_pool_pages_total = {
10031010
'description': "The total size of buffer pool, in pages",
10041011
'value_type':'uint',

0 commit comments

Comments
 (0)