Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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',
Esempio n. 5
0
def dirty_job_metrics():
    metrics.measure('gauges.dirty_jobs', Job.query.filter(Job.is_dirty).count())
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 11
0
        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}]
Esempio n. 12
0
def dirty_job_metrics():
    metrics.measure('gauges.dirty_jobs', Job.query.filter(Job.is_dirty).count())
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)