示例#1
0
文件: nginx.py 项目: marcoshack/pat
 def test_find_load_periods_with_loads(self):
     reqs = nginx.load_access_log_data('test/fixtures/nginx_test-with_loads.csv', save_binary=False)
     reqs, rps = nginx.summary(reqs)
     periods = nginx.find_load_periods(rps, surrounding_period=5, rps_threashold=20, load_pause_period=5)
     self.assertEquals(len(periods), 2)
     self.assertEquals(periods[0].start, 1444359676)
     self.assertEquals(periods[0].end, 1444359688)
     self.assertEquals(periods[0].duration(), 12)
     self.assertEquals(periods[1].start, 1444359716)
     self.assertEquals(periods[1].end, 1444359726)
     self.assertEquals(periods[1].duration(), 10)
示例#2
0
文件: nginx.py 项目: marcoshack/pat
 def test_summary_with_no_start_date_and_period(self):
     reqs, rps = nginx.summary(self.reqs, stats=False)
     self.assertEquals(len(reqs), len(self.reqs))
     self.assertEquals(len(rps), 41)