示例#1
0
def _system_count_metrics_for_query_grouped(name, grouping, query):
    group_counts = utilisation.system_utilisation_counts_by_group(grouping, query)
    for group, counts in group_counts.iteritems():
        for state, count in counts.iteritems():
            if state != 'idle_removed':
                metrics.measure('gauges.systems_%s.%s.%s' % (state, name,
                        group.replace('.', '_')), count)
示例#2
0
def _system_count_metrics_for_query_grouped(name, grouping, query):
    group_counts = utilisation.system_utilisation_counts_by_group(grouping, query)
    for group, counts in group_counts.iteritems():
        for state, count in counts.iteritems():
            if state != 'idle_removed':
                metrics.measure('gauges.systems_%s.%s.%s' % (state, name,
                        group.replace('.', '_')), count)
示例#3
0
def _system_command_metrics_for_query_grouped(name, grouping, query):
    group_counts = Command.get_queue_stats_by_group(grouping, query)
    for group, counts in group_counts.iteritems():
        for status, count in counts.iteritems():
            metrics.measure(
                'gauges.system_commands_%s.%s.%s' %
                (status, name, group.replace('.', '_')), count)
示例#4
0
                job.cc.append(email_validator.to_python(addr))
            except Invalid, e:
                raise BX(
                    _('Invalid e-mail address %r in <cc/>: %s') %
                    (addr, str(e)))
        for xmlrecipeSet in xmljob.iter_recipeSets():
            recipe_set = self._handle_recipe_set(
                xmlrecipeSet, owner, ignore_missing_tasks=ignore_missing_tasks)
            job.recipesets.append(recipe_set)
            job.ttasks += recipe_set.ttasks

        if not job.recipesets:
            raise BX(
                _('No RecipeSets! You can not have a Job with no recipeSets!'))
        session.add(job)
        metrics.measure('counters.recipes_submitted',
                        len(list(job.all_recipes)))
        return job

    def _jobs(self, job, **kw):
        return_dict = {}
        # We can do a quick search, or a regular simple search. If we have done neither of these,
        # it will fall back to an advanced search and look in the 'jobsearch'

        # simplesearch set to None will display the advanced search, otherwise in the simplesearch
        # textfield it will display the value assigned to it
        simplesearch = None
        if kw.get('simplesearch'):
            value = kw['simplesearch']
            kw['jobsearch'] = [{
                'table': 'Id',
                'operation': 'is',
示例#5
0
def dirty_job_metrics():
    metrics.measure('gauges.dirty_jobs', Job.query.filter(Job.is_dirty).count())
示例#6
0
def _system_command_metrics_for_query_grouped(name, grouping, query):
    group_counts = CommandActivity.get_queue_stats_by_group(grouping, query)
    for group, counts in group_counts.iteritems():
        for status, count in counts.iteritems():
            metrics.measure('gauges.system_commands_%s.%s.%s'
                    % (status, name, group.replace('.', '_')), count)
示例#7
0
def _system_command_metrics_for_query(name, query):
    for status, count in CommandActivity.get_queue_stats(query).items():
        metrics.measure('gauges.system_commands_%s.%s' % (status, name), count)
示例#8
0
def _system_count_metrics_for_query(name, query):
    counts = utilisation.system_utilisation_counts(query)
    for state, count in counts.iteritems():
        if state != 'idle_removed':
            metrics.measure('gauges.systems_%s.%s' % (state, name), count)
示例#9
0
def _recipe_count_metrics_for_query_grouped(name, grouping, query):
    group_counts = MachineRecipe.get_queue_stats_by_group(grouping, query)
    for group, counts in group_counts.iteritems():
        for status, count in counts.iteritems():
            metrics.measure('gauges.recipes_%s.%s.%s' %
                                   (status, name, group), count)
示例#10
0
def _recipe_count_metrics_for_query(name, query=None):
    for status, count in MachineRecipe.get_queue_stats(query).items():
        metrics.measure('gauges.recipes_%s.%s' % (status, name), count)
示例#11
0
文件: jobs.py 项目: ustbgaofan/beaker
        email_validator = validators.Email(not_empty=True)
        for addr in set(xmljob.iter_cc()):
            try:
                job.cc.append(email_validator.to_python(addr))
            except Invalid, e:
                raise BX(_('Invalid e-mail address %r in <cc/>: %s') % (addr, str(e)))
        for xmlrecipeSet in xmljob.iter_recipeSets():
            recipe_set = self._handle_recipe_set(xmlrecipeSet, owner,
                    ignore_missing_tasks=ignore_missing_tasks)
            job.recipesets.append(recipe_set)
            job.ttasks += recipe_set.ttasks

        if not job.recipesets:
            raise BX(_('No RecipeSets! You can not have a Job with no recipeSets!'))
        session.add(job)
        metrics.measure('counters.recipes_submitted', len(list(job.all_recipes)))
        return job

    def _jobs(self,job,**kw):
        return_dict = {}
        # We can do a quick search, or a regular simple search. If we have done neither of these,
        # it will fall back to an advanced search and look in the 'jobsearch'

        # simplesearch set to None will display the advanced search, otherwise in the simplesearch
        # textfield it will display the value assigned to it
        simplesearch = None
        if kw.get('simplesearch'):
            value = kw['simplesearch']
            kw['jobsearch'] = [{'table' : 'Id',
                                 'operation' : 'is',
                                 'value' : value}]
示例#12
0
def dirty_job_metrics():
    metrics.measure('gauges.dirty_jobs', Job.query.filter(Job.is_dirty).count())
示例#13
0
def _system_command_metrics_for_query(name, query):
    for status, count in Command.get_queue_stats(query).items():
        metrics.measure('gauges.system_commands_%s.%s' % (status, name), count)
示例#14
0
def _system_count_metrics_for_query(name, query):
    counts = utilisation.system_utilisation_counts(query)
    for state, count in counts.iteritems():
        if state != 'idle_removed':
            metrics.measure('gauges.systems_%s.%s' % (state, name), count)
示例#15
0
def _recipe_count_metrics_for_query_grouped(name, grouping, query):
    group_counts = MachineRecipe.get_queue_stats_by_group(grouping, query)
    for group, counts in group_counts.iteritems():
        for status, count in counts.iteritems():
            metrics.measure('gauges.recipes_%s.%s.%s' %
                                   (status, name, group), count)
示例#16
0
def _recipe_count_metrics_for_query(name, query=None):
    for status, count in MachineRecipe.get_queue_stats(query).items():
        metrics.measure('gauges.recipes_%s.%s' % (status, name), count)