From 99137ab005df346e3398231f86d1b4bb19d461df Mon Sep 17 00:00:00 2001 From: Morgan Richomme Date: Fri, 24 Feb 2017 08:59:11 +0100 Subject: Add storperf reportign status page Create associated static storperf page Prepare vsperf, qtip, bottlenecks Put Yardstick scenario class into utils directory Change-Id: I874d1733fe3f37dc5dd557559478e7e0b25371d7 Signed-off-by: Morgan Richomme --- reporting/utils/reporting_utils.py | 10 +++++++++- reporting/utils/scenarioResult.py | 29 +++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 reporting/utils/scenarioResult.py (limited to 'reporting/utils') diff --git a/reporting/utils/reporting_utils.py b/reporting/utils/reporting_utils.py index 1879fb6..47d67f3 100644 --- a/reporting/utils/reporting_utils.py +++ b/reporting/utils/reporting_utils.py @@ -101,7 +101,15 @@ def getApiResults(case, installer, scenario, version): def getScenarios(case, installer, version): - case = case.getName() + try: + case = case.getName() + except: + # if case is not an object test case, try the string + if type(case) == str: + case = case + else: + raise ValueError("Case cannot be evaluated") + period = get_config('general.period') url_base = get_config('testapi.url') diff --git a/reporting/utils/scenarioResult.py b/reporting/utils/scenarioResult.py new file mode 100644 index 0000000..1f7eb2b --- /dev/null +++ b/reporting/utils/scenarioResult.py @@ -0,0 +1,29 @@ +#!/usr/bin/python +# +# This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# + + +class ScenarioResult(object): + def __init__(self, status, four_days_score='', ten_days_score='', + score_percent=0.0): + self.status = status + self.four_days_score = four_days_score + self.ten_days_score = ten_days_score + self.score_percent = score_percent + + def getStatus(self): + return self.status + + def getTenDaysScore(self): + return self.ten_days_score + + def getFourDaysScore(self): + return self.four_days_score + + def getScorePercent(self): + return self.score_percent -- cgit 1.2.3-korg