From 59ec865da630f635eefee055ae85e1c956d42de7 Mon Sep 17 00:00:00 2001 From: shockrah Date: Sun, 17 Oct 2021 16:40:19 -0700 Subject: [PATCH] * fixing pad theme name --- gitpage/config.toml | 2 +- scripts/benchmark.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 scripts/benchmark.py diff --git a/gitpage/config.toml b/gitpage/config.toml index 2b27228..26fd643 100644 --- a/gitpage/config.toml +++ b/gitpage/config.toml @@ -3,7 +3,7 @@ languageCode = 'en-us' title = 'What is Clippable' description = "A self hostable solution to clip sharing" -theme = "dimension-hugo" +theme = "dimension" [params] author = "shockrah" diff --git a/scripts/benchmark.py b/scripts/benchmark.py new file mode 100644 index 0000000..268c51e --- /dev/null +++ b/scripts/benchmark.py @@ -0,0 +1,43 @@ +import json +import subprocess + +''' +{ + 'transactions': 3564, + 'availability': 100.0, + 'elapsed_time': 4.38, + 'data_transferred': 7.1, + 'response_time': 0.08, + 'transaction_rate': 813.7, + 'throughput': 1.62, + 'concurrency': 61.21, + 'successful_transactions': 3564, + 'failed_transactions': 0, + 'longest_transaction': 3.28, + 'shortest_transaction': 0.0 +} +''' + +def color(text: str, color: str): + text = text.lower() + colors = { + 'red': '\e[0;31m', + 'blue': '\e[0;34m', + 'green': '\e[0;32m' + } + nc = '\e[0m' + if text not in colors: + return text + else: + return colors[color] + text + nc + +if __name__ == '__main__': + print('Starting') + proc = subprocess.run( + 'siege -q -t 5S -c 200 http://localhost/'.split(), + text=True, + capture_output=True + ) + result = json.loads(proc.stdout) + print(json.dumps(result,indent=2)) +