Skip to content

Lack RW-sx metrics, which are missed on mysql integration #11029

Open
@komeda-shinji

Description

@komeda-shinji

I'm getting values for these six metrics.

  • mysql.innodb.s_lock_os_waits
  • mysql.innodb.s_lock_spin_waits
  • mysql.innodb.s_lock_spin_rounds
  • mysql.innodb.x_lock_os_waits
  • mysql.innodb.x_lock_spin_waits
  • mysql.innodb.x_lock_spin_rounds

However, there are no values for the three metrics for RW-sx spins.

  • mysql.innodb.sx_lock_os_waits
  • mysql.innodb.sx_lock_spin_waits
  • mysql.innodb.sx_lock_spin_rounds

The operation to get the values of these metrics from the result of SHOW ENGINE INNODB STATUS is not implemented in mysql integration.

# SEMAPHORES
if line.find('Mutex spin waits') == 0:
# Mutex spin waits 79626940, rounds 157459864, OS waits 698719
# Mutex spin waits 0, rounds 247280272495, OS waits 316513438
results['Innodb_mutex_spin_waits'] = long(row[3])
results['Innodb_mutex_spin_rounds'] = long(row[5])
results['Innodb_mutex_os_waits'] = long(row[8])
elif line.find('RW-shared spins') == 0 and line.find(';') > 0:
# RW-shared spins 3859028, OS waits 2100750; RW-excl spins
# 4641946, OS waits 1530310
results['Innodb_s_lock_spin_waits'] = long(row[2])
results['Innodb_x_lock_spin_waits'] = long(row[8])
results['Innodb_s_lock_os_waits'] = long(row[5])
results['Innodb_x_lock_os_waits'] = long(row[11])
elif line.find('RW-shared spins') == 0 and line.find('; RW-excl spins') == -1:
# Post 5.5.17 SHOW ENGINE INNODB STATUS syntax
# RW-shared spins 604733, rounds 8107431, OS waits 241268
results['Innodb_s_lock_spin_waits'] = long(row[2])
results['Innodb_s_lock_spin_rounds'] = long(row[4])
results['Innodb_s_lock_os_waits'] = long(row[7])
elif line.find('RW-excl spins') == 0:
# Post 5.5.17 SHOW ENGINE INNODB STATUS syntax
# RW-excl spins 604733, rounds 8107431, OS waits 241268
results['Innodb_x_lock_spin_waits'] = long(row[2])
results['Innodb_x_lock_spin_rounds'] = long(row[4])
results['Innodb_x_lock_os_waits'] = long(row[7])
elif line.find('seconds the semaphore:') > 0:
# --Thread 907205 has waited at handler/ha_innodb.cc line 7156 for 1.00 seconds the semaphore:
results['Innodb_semaphore_waits'] += 1
results['Innodb_semaphore_wait_time'] += long(float(row[9])) * 1000

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions