def _build_indexed_data_table()

in lnt/server/reporting/summaryreport.py [0:0]


    def _build_indexed_data_table(self):
        def is_in_execution_time_filter(name):
            for key in ("SPEC", "ClamAV", "lencod", "minisat", "SIBSim4",
                        "SPASS", "sqlite3", "viterbi", "Bullet"):
                if key in name:
                    return True

        def compute_index_name(key):
            test_name,metric,arch,build_mode,machine_id = key

            # If this is a nightly test..
            if test_name.startswith('SingleSource/') or \
                    test_name.startswith('MultiSource/') or \
                    test_name.startswith('External/'):
                # If this is a compile time test, aggregate all values into a
                # cumulative compile time.
                if metric == 'Compile Time':
                    return ('Lmark', metric, build_mode, arch, machine_id), Sum

                # Otherwise, this is an execution time. Index the cumulative
                # result of a limited set of benchmarks.
                assert metric == 'Execution Time'
                if is_in_execution_time_filter(test_name):
                    return ('Lmark', metric, build_mode, arch, machine_id), Sum

                # Otherwise, ignore the test.
                return

            # Otherwise, we have a compile time suite test.

            # Ignore user time results for now.
            if not test_name.endswith('.wall_time'):
                return

            # Index full builds across all job sizes.
            if test_name.startswith('build/'):
                project_name,subtest_name = re.match(
                    r'build/(.*)\(j=[0-9]+\)\.(.*)', str(test_name)).groups()
                return (('Full Build (%s)' % (project_name,),
                         metric, build_mode, arch, machine_id),
                        NormalizedMean)

            # Index single file tests across all inputs.
            if test_name.startswith('compile/'):
                file_name,stage_name,subtest_name = re.match(
                    r'compile/(.*)/(.*)/\(\)\.(.*)', str(test_name)).groups()
                return (('Single File (%s)' % (stage_name,),
                         metric, build_mode, arch, machine_id),
                        Mean)

            # Index PCH generation tests by input.
            if test_name.startswith('pch-gen/'):
                file_name,subtest_name = re.match(
                    r'pch-gen/(.*)/\(\)\.(.*)', str(test_name)).groups()
                return (('PCH Generation (%s)' % (file_name,),
                         metric, build_mode, arch, machine_id),
                        Mean)

            # Otherwise, ignore the test.
            return

        def is_missing_samples(values):
            for samples in values:
                if not samples:
                    return True

        self.indexed_data_table = {}
        for key,values in self.data_table.items():
            # Ignore any test which is missing some data.
            if is_missing_samples(values):
                self.warnings.append("missing values for %r" % (key,))
                continue

            # Select the median values.
            medians = [lnt.util.stats.median(samples)
                       for samples in values]

            # Compute the index name, and ignore unused tests.
            result = compute_index_name(key)
            if result is None:
                continue

            index_name,index_class = result
            item = self.indexed_data_table.get(index_name)
            if item is None:
                self.indexed_data_table[index_name] = item = index_class()
            item.append(medians)