From e2d618f472e69000c1a825d1d9e94337a6acbf4e Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Mon, 12 Aug 2019 00:49:33 -0400 Subject: [PATCH] formatting in time_to_first_byte.py -pending claim_type being usable in claim_search, don't try downloading channel claims in time_to_first_byte.py --- lbry/scripts/time_to_first_byte.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lbry/scripts/time_to_first_byte.py b/lbry/scripts/time_to_first_byte.py index 12b492de4..88de9e48f 100644 --- a/lbry/scripts/time_to_first_byte.py +++ b/lbry/scripts/time_to_first_byte.py @@ -75,7 +75,7 @@ async def main(cmd_args=None): return 1 else: url_to_claim.update({ - claim['permanent_url']: claim for claim in response['items'] + claim['permanent_url']: claim for claim in response['items'] if claim['value_type'] == 'stream' }) print(f'Claim search page {page} took: {time.perf_counter() - start}') except (ClientConnectorError, ConnectionError): @@ -127,7 +127,7 @@ async def main(cmd_args=None): if first_byte_times: result += f"Worst first byte time: {round(max(first_byte_times), 2)}\n" \ f"Best first byte time: {round(min(first_byte_times), 2)}\n" \ - f"95% confidence time-to-first-byte: {confidence(first_byte_times, 1.984)}s\n" \ + f"*95% confidence time-to-first-byte: {confidence(first_byte_times, 1.984)}s*\n" \ f"99% confidence time-to-first-byte: {confidence(first_byte_times, 2.626)}s\n" \ f"Variance: {variance(first_byte_times)}\n" if download_successes: @@ -140,7 +140,7 @@ async def main(cmd_args=None): for reason in ('start', 'finish'): failures = [url for url, why in failed_to.items() if reason == why] if failures: - result += f"\nFailed to {reason}:\n" + "\n".join(failures) + result += f"\nFailed to {reason}:\n" + "\n•".join(failures) print(result) webhook = os.environ.get('TTFB_SLACK_TOKEN', None)