# check that we get a positive time_taken reported on a simple GET def test_h2_009_01(self, env):
path = '/002.jpg'
url = env.mkurl("https", "test1", f'{path}?01')
args = [
env.h2load, "-n", "1", "-c", "1", "-m", "1",
f"--connect-to=localhost:{env.https_port}",
f"--base-uri={url}", url
]
r = env.run(args) # Restart for logs to be flushed out assert env.apache_restart() == 0
found = False for line in open(TestTiming.LOGFILE).readlines():
e = json.loads(line) if e['request'] == f'GET {path}?01 HTTP/2.0': assert e['time_taken'] > 0
found = True assert found, f'request not found in {TestTiming.LOGFILE}'
# test issue #253, where time_taken in a keepalive situation is not # reported until the next request arrives def test_h2_009_02(self, env):
baseurl = env.mkurl("https", "test1", '/')
tscript = os.path.join(env.gen_dir, 'h2load-timing-009_02') with open(tscript, 'w') as fd:
fd.write('\n'.join([
f'0.0\t/002.jpg?02a', # 1st request right away
f'1000.0\t/002.jpg?02b', # 2nd a second later
]))
args = [
env.h2load,
f'--timing-script-file={tscript}',
f"--connect-to=localhost:{env.https_port}",
f"--base-uri={baseurl}"
]
r = env.run(args) # Restart for logs to be flushed out assert env.apache_restart() == 0
found = False for line in open(TestTiming.LOGFILE).readlines():
e = json.loads(line) if e['request'] == f'GET /002.jpg?02a HTTP/2.0': assert e['time_taken'] > 0 assert e['time_taken'] < 500 * 1000, f'time for 1st request not reported correctly'
found = True assert found, f'request not found in {TestTiming.LOGFILE}'
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.