本文整理匯總了Python中haproxy.logfile.Log.cmd_average_response_time方法的典型用法代碼示例。如果您正苦於以下問題:Python Log.cmd_average_response_time方法的具體用法?Python Log.cmd_average_response_time怎麽用?Python Log.cmd_average_response_time使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類haproxy.logfile.Log
的用法示例。
在下文中一共展示了Log.cmd_average_response_time方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_cmd_average_response_time
# 需要導入模塊: from haproxy.logfile import Log [as 別名]
# 或者: from haproxy.logfile.Log import cmd_average_response_time [as 別名]
def test_cmd_average_response_time(self):
"""Check that the average response time returns the expected output."""
log_file = Log(
logfile='haproxy/tests/files/average_response.log',
)
data = log_file.cmd_average_response_time()
self.assertEqual(data, 105)
示例2: test_cmd_average_response_time_empty_log
# 需要導入模塊: from haproxy.logfile import Log [as 別名]
# 或者: from haproxy.logfile.Log import cmd_average_response_time [as 別名]
def test_cmd_average_response_time_empty_log(self):
"""Check that the average response time does not break if no log lines
are logged.
"""
log_file = Log(
logfile='haproxy/tests/files/empty.log',
)
data = log_file.cmd_average_response_time()
self.assertEqual(data, 0)
示例3: test_cmd_average_response_time_no_wait
# 需要導入模塊: from haproxy.logfile import Log [as 別名]
# 或者: from haproxy.logfile.Log import cmd_average_response_time [as 別名]
def test_cmd_average_response_time_no_wait(self):
"""Check that the average response time returns the expected output
when there are connections that did not take any millisecond to reply.
"""
log_file = Log(
logfile='haproxy/tests/files/average_response_no_wait.log',
)
data = log_file.cmd_average_response_time()
self.assertEqual(data, 74)
示例4: test_cmd_average_response_time_aborted
# 需要導入模塊: from haproxy.logfile import Log [as 別名]
# 或者: from haproxy.logfile.Log import cmd_average_response_time [as 別名]
def test_cmd_average_response_time_aborted(self):
"""Check that the average response time returns the expected output
when there are aborted connections.
"""
log_file = Log(
logfile='haproxy/tests/files/average_response_aborted.log',
)
data = log_file.cmd_average_response_time()
self.assertEqual(data, 110)