Пример #1
0
    def get_plot_data(self, started=None, ended=None, choice_ids=None, columns=None):
        """See :meth:`metrics.registry.MetricsTypeProvider.get_plot_data`."""

        # Fetch all the matching job type metrics based on query filters
        entries = MetricsJobType.objects.all().order_by('occurred')
        if started:
            entries = entries.filter(occurred__gte=started)
        if ended:
            entries = entries.filter(occurred__lte=ended)
        if choice_ids:
            entries = entries.filter(job_type_id__in=choice_ids)
        if not columns:
            columns = self.get_metrics_type().columns
        column_names = [c.name for c in columns]
        entries = entries.values('job_type_id', 'occurred', *column_names)
        # Convert the database models to plot models
        return MetricsPlotData.create(entries, 'occurred', 'job_type_id', choice_ids, columns)
Пример #2
0
    def get_plot_data(self, started=None, ended=None, choice_ids=None, columns=None):
        '''See :meth:`metrics.registry.MetricsTypeProvider.get_plot_data`.'''

        # Fetch all the matching job type metrics based on query filters
        entries = MetricsJobType.objects.all().order_by('occurred')
        if started:
            entries = entries.filter(occurred__gte=started)
        if ended:
            entries = entries.filter(occurred__lte=ended)
        if choice_ids:
            entries = entries.filter(job_type_id__in=choice_ids)
        if not columns:
            columns = self.get_metrics_type().columns
        column_names = [c.name for c in columns]
        entries = entries.values('job_type_id', 'occurred', *column_names)

        # Convert the database models to plot models
        return MetricsPlotData.create(entries, 'occurred', 'job_type_id', choice_ids, columns)
Пример #3
0
    def get_plot_data(self, started=None, ended=None, choice_ids=None, columns=None):
        """See :meth:`metrics.registry.MetricsTypeProvider.get_plot_data`."""

        # Fetch all the matching ingest metrics based on query filters
        entries = MetricsIngest.objects.all().order_by("occurred")
        if started:
            entries = entries.filter(occurred__gte=started)
        if ended:
            entries = entries.filter(occurred__lte=ended)
        if choice_ids:
            entries = entries.filter(strike_id__in=choice_ids)
        if not columns:
            columns = self.get_metrics_type().columns
        column_names = [c.name for c in columns]
        entries = entries.values("strike_id", "occurred", *column_names)

        # Convert the database models to plot models
        return MetricsPlotData.create(entries, "occurred", "strike_id", choice_ids, columns)