Adding Timing metrics for DRAC drivers.

This change adds timing metrics for method in the bios, deploy, inspect, management,
power, raid, vendor_passthru modules

Change-Id: Ib301f203badecf4834dae5bba35175d13c4545cf
Closes-Bug: #1611555
This commit is contained in:
Annie Lezil 2016-09-27 18:17:58 +00:00
parent 70b992ca57
commit f91d83a56e
7 changed files with 46 additions and 0 deletions

View File

@ -15,6 +15,8 @@
DRAC deploy interface
"""
from ironic_lib import metrics_utils
from ironic.drivers.modules import deploy_utils
from ironic.drivers.modules import iscsi_deploy
@ -23,9 +25,12 @@ _OOB_CLEAN_STEPS = [
{'interface': 'raid', 'step': 'delete_configuration'}
]
METRICS = metrics_utils.get_metrics_logger(__name__)
class DracDeploy(iscsi_deploy.ISCSIDeploy):
@METRICS.timer('DracDeploy.prepare_cleaning')
def prepare_cleaning(self, task):
"""Prepare environment for cleaning

View File

@ -15,6 +15,7 @@
DRAC inspection interface
"""
from ironic_lib import metrics_utils
from oslo_log import log as logging
from oslo_utils import importutils
from oslo_utils import units
@ -33,6 +34,8 @@ drac_exceptions = importutils.try_import('dracclient.exceptions')
LOG = logging.getLogger(__name__)
METRICS = metrics_utils.get_metrics_logger(__name__)
class DracInspect(base.InspectInterface):
@ -43,6 +46,7 @@ class DracInspect(base.InspectInterface):
"""
return drac_common.COMMON_PROPERTIES
@METRICS.timer('DracInspect.validate')
def validate(self, task):
"""Validate the driver-specific info supplied.
@ -57,6 +61,7 @@ class DracInspect(base.InspectInterface):
"""
return drac_common.parse_driver_info(task.node)
@METRICS.timer('DracInspect.inspect_hardware')
def inspect_hardware(self, task):
"""Inspect hardware.

View File

@ -19,6 +19,7 @@
DRAC management interface
"""
from ironic_lib import metrics_utils
from oslo_log import log as logging
from oslo_utils import importutils
@ -34,6 +35,8 @@ drac_exceptions = importutils.try_import('dracclient.exceptions')
LOG = logging.getLogger(__name__)
METRICS = metrics_utils.get_metrics_logger(__name__)
_BOOT_DEVICES_MAP = {
boot_devices.DISK: 'HardDisk',
boot_devices.PXE: 'NIC',
@ -123,6 +126,7 @@ class DracManagement(base.ManagementInterface):
"""Return the properties of the interface."""
return drac_common.COMMON_PROPERTIES
@METRICS.timer('DracManagement.validate')
def validate(self, task):
"""Validate the driver-specific info supplied.
@ -137,6 +141,7 @@ class DracManagement(base.ManagementInterface):
"""
return drac_common.parse_driver_info(task.node)
@METRICS.timer('DracManagement.get_supported_boot_devices')
def get_supported_boot_devices(self, task):
"""Get a list of the supported boot devices.
@ -147,6 +152,7 @@ class DracManagement(base.ManagementInterface):
"""
return list(_BOOT_DEVICES_MAP.keys())
@METRICS.timer('DracManagement.get_boot_device')
def get_boot_device(self, task):
"""Get the current boot device for a node.
@ -169,6 +175,7 @@ class DracManagement(base.ManagementInterface):
return _get_boot_device(node)
@METRICS.timer('DracManagement.set_boot_device')
@task_manager.require_exclusive_lock
def set_boot_device(self, task, device, persistent=False):
"""Set the boot device for a node.
@ -205,6 +212,7 @@ class DracManagement(base.ManagementInterface):
node.driver_internal_info = driver_internal_info
node.save()
@METRICS.timer('DracManagement.get_sensors_data')
def get_sensors_data(self, task):
"""Get sensors data.

View File

@ -15,6 +15,7 @@
DRAC power interface
"""
from ironic_lib import metrics_utils
from oslo_log import log as logging
from oslo_utils import importutils
@ -31,6 +32,8 @@ drac_exceptions = importutils.try_import('dracclient.exceptions')
LOG = logging.getLogger(__name__)
METRICS = metrics_utils.get_metrics_logger(__name__)
if drac_constants:
POWER_STATES = {
drac_constants.POWER_ON: states.POWER_ON,
@ -119,6 +122,7 @@ class DracPower(base.PowerInterface):
"""Return the properties of the interface."""
return drac_common.COMMON_PROPERTIES
@METRICS.timer('DracPower.validate')
def validate(self, task):
"""Validate the driver-specific Node power info.
@ -132,6 +136,7 @@ class DracPower(base.PowerInterface):
"""
return drac_common.parse_driver_info(task.node)
@METRICS.timer('DracPower.get_power_state')
def get_power_state(self, task):
"""Return the power state of the node.
@ -143,6 +148,7 @@ class DracPower(base.PowerInterface):
"""
return _get_power_state(task.node)
@METRICS.timer('DracPower.set_power_state')
@task_manager.require_exclusive_lock
def set_power_state(self, task, power_state):
"""Set the power state of the node.
@ -155,6 +161,7 @@ class DracPower(base.PowerInterface):
"""
_set_power_state(task.node, power_state)
@METRICS.timer('DracPower.reboot')
@task_manager.require_exclusive_lock
def reboot(self, task):
"""Perform a reboot of the task's node.

View File

@ -18,6 +18,7 @@ DRAC RAID specific methods
import math
from futurist import periodics
from ironic_lib import metrics_utils
from oslo_log import log as logging
from oslo_utils import importutils
from oslo_utils import units
@ -37,6 +38,8 @@ drac_exceptions = importutils.try_import('dracclient.exceptions')
LOG = logging.getLogger(__name__)
METRICS = metrics_utils.get_metrics_logger(__name__)
RAID_LEVELS = {
'0': {
'min_disks': 1,
@ -663,6 +666,7 @@ class DracRAID(base.RAIDInterface):
"""Return the properties of the interface."""
return drac_common.COMMON_PROPERTIES
@METRICS.timer('DracRAID.create_configuration')
@base.clean_step(priority=0, abortable=False, argsinfo={
'create_root_volume': {
'description': (
@ -740,6 +744,7 @@ class DracRAID(base.RAIDInterface):
return _commit_to_controllers(node, list(controllers))
@METRICS.timer('DracRAID.delete_configuration')
@base.clean_step(priority=0)
def delete_configuration(self, task):
"""Delete the RAID configuration.
@ -758,6 +763,7 @@ class DracRAID(base.RAIDInterface):
return _commit_to_controllers(node, list(controllers))
@METRICS.timer('DracRAID.get_logical_disks')
def get_logical_disks(self, task):
"""Get the RAID configuration of the node.
@ -783,6 +789,7 @@ class DracRAID(base.RAIDInterface):
return {'logical_disks': logical_disks}
@METRICS.timer('DracRAID._query_raid_config_job_status')
@periodics.periodic(
spacing=CONF.drac.query_raid_config_job_status_interval)
def _query_raid_config_job_status(self, manager, context):
@ -816,6 +823,7 @@ class DracRAID(base.RAIDInterface):
"%(node)s was already locked by another process. "
"Skip."), {'node': node_uuid})
@METRICS.timer('DracRAID._check_node_raid_jobs')
def _check_node_raid_jobs(self, task):
"""Check the progress of running RAID config jobs of a node."""

View File

@ -15,6 +15,8 @@
DRAC vendor-passthru interface
"""
from ironic_lib import metrics_utils
from ironic.common.i18n import _
from ironic.conductor import task_manager
from ironic.drivers import base
@ -22,6 +24,8 @@ from ironic.drivers.modules.drac import bios as drac_bios
from ironic.drivers.modules.drac import common as drac_common
from ironic.drivers.modules.drac import job as drac_job
METRICS = metrics_utils.get_metrics_logger(__name__)
class DracVendorPassthru(base.VendorInterface):
"""Interface for DRAC specific methods."""
@ -30,6 +34,7 @@ class DracVendorPassthru(base.VendorInterface):
"""Return the properties of the interface."""
return drac_common.COMMON_PROPERTIES
@METRICS.timer('DracVendorPassthru.validate')
def validate(self, task, **kwargs):
"""Validate the driver-specific info supplied.
@ -44,6 +49,7 @@ class DracVendorPassthru(base.VendorInterface):
"""
return drac_common.parse_driver_info(task.node)
@METRICS.timer('DracVendorPassthru.get_bios_config')
@base.passthru(['GET'], async=False,
description=_("Returns a dictionary containing the BIOS "
"settings from a node."))
@ -65,6 +71,7 @@ class DracVendorPassthru(base.VendorInterface):
return bios_attrs
@METRICS.timer('DracVendorPassthru.set_bios_config')
@base.passthru(['POST'], async=False,
description=_("Change the BIOS configuration on a node. "
"Required argument : a dictionary of "
@ -88,6 +95,7 @@ class DracVendorPassthru(base.VendorInterface):
"""
return drac_bios.set_config(task, **kwargs)
@METRICS.timer('DracVendorPassthru.commit_bios_config')
@base.passthru(['POST'], async=False,
description=_("Commit a BIOS configuration job submitted "
"through set_bios_config(). Required "
@ -119,6 +127,7 @@ class DracVendorPassthru(base.VendorInterface):
job_id = drac_bios.commit_config(task, reboot=reboot)
return {'job_id': job_id, 'reboot_required': not reboot}
@METRICS.timer('DracVendorPassthru.abandon_bios_config')
@base.passthru(['DELETE'], async=False,
description=_("Abandon a BIOS configuration job previously "
"submitted through set_bios_config()."))

View File

@ -0,0 +1,4 @@
---
features:
- Adds timing metrics to DRAC drivers.