From 2898568579f88ff3c055ae1f9aa56c8eb9d20c20 Mon Sep 17 00:00:00 2001 From: zhiyang7 Date: Wed, 29 Dec 2021 18:01:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=80=89=E6=8B=A9baseline?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- evaluate_server.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/evaluate_server.py b/evaluate_server.py index 2589baa..0c73cb2 100644 --- a/evaluate_server.py +++ b/evaluate_server.py @@ -62,7 +62,11 @@ def charts(): @app.route('/metrics', methods=['GET']) def metrics(): type = request.args.get('type') - baselines = Baseline.select().order_by(Baseline.rank.desc()).limit(3) + baseline = request.args.get('baseline') + if baseline is None: + baselines = Baseline.select().order_by(Baseline.rank.desc()).limit(3) + else: + baselines = Baseline.select().where(Baseline.rank <= baseline).order_by(Baseline.rank.desc()).limit(3) metrics = {} for i in range(len(baselines)): baseline = baselines[i]