예제 #1
0
    def test_hole_in_thread_numbers(self):
        parsed = test_lib.parse_string("""
        Clocks
        SystemTime,1
        MetricsTime,2

        Timers
        12,A.0.o,50
        13,A.3.o,50
        """)
        actual = perf_json.translate(parsed.timers())
        self.assertEqual(
            actual, {
                'results': [{
                    'end': 0.00012,
                    'name': 'A.o',
                    'results': {
                        2: {
                            'ops_per_sec': 50.0,
                            'ops_per_sec_values': [50.0]
                        }
                    },
                    'start': -0.00039,
                    'workload': 'A.o'
                }],
            })
예제 #2
0
    def test_csv_no_sections_have_data(self):
        self.assertEqual(
            test_lib.parse_string("""
        Clocks

        Gauges

        Counters

        Timers
        """).timers(), {})
예제 #3
0
 def test_empty_input(self):
     self.assertEqual(test_lib.parse_string("").timers(), {})
예제 #4
0
 def raises_parse_error(self, input_str):
     with self.assertRaises(parser.ParseError):
         test_lib.parse_string(input_str)