当前位置: 首页>>代码示例>>Python>>正文


Python atomic.action_timer方法代码示例

本文整理汇总了Python中rally.task.atomic.action_timer方法的典型用法代码示例。如果您正苦于以下问题:Python atomic.action_timer方法的具体用法?Python atomic.action_timer怎么用?Python atomic.action_timer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rally.task.atomic的用法示例。


在下文中一共展示了atomic.action_timer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _run_job_execution

# 需要导入模块: from rally.task import atomic [as 别名]
# 或者: from rally.task.atomic import action_timer [as 别名]
def _run_job_execution(self, job_id, cluster_id, input_id, output_id,
                           configs, job_idx):
        """Run a Job Execution and wait until it completes or fails.

        The Job Execution is accepted as successful when Oozie reports
        "success" or "succeeded" status. The failure statuses are "failed" and
        "killed".

        The timeout and the polling interval may be configured through
        "sahara_job_execution_timeout" and "sahara_job_check_interval"
        parameters under the "benchmark" section.

        :param job_id: The Job id that will be executed
        :param cluster_id: The Cluster id which will execute the Job
        :param input_id: The input Data Source id
        :param output_id: The output Data Source id
        :param configs: The config dict that will be passed as Job Execution's
                        parameters.
        :param job_idx: The index of a job in a sequence

        """
        @atomic.action_timer("sahara.job_execution_%s" % job_idx)
        def run(self):
            job_execution = self.clients("sahara").job_executions.create(
                job_id=job_id,
                cluster_id=cluster_id,
                input_id=input_id,
                output_id=output_id,
                configs=configs)

            utils.wait_for(
                resource=job_execution.id,
                is_ready=self._job_execution_is_finished,
                timeout=CONF.openstack.sahara_job_execution_timeout,
                check_interval=CONF.openstack.sahara_job_check_interval)

        run(self) 
开发者ID:openstack,项目名称:rally-openstack,代码行数:39,代码来源:utils.py


注:本文中的rally.task.atomic.action_timer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。