Migrate contents from benchmarks to resources 07/39407/1
authorYujun Zhang <zhang.yujunz@zte.com.cn>
Wed, 16 Aug 2017 08:31:44 +0000 (16:31 +0800)
committerYujun Zhang <zhang.yujunz@zte.com.cn>
Wed, 16 Aug 2017 08:36:26 +0000 (16:36 +0800)
Change-Id: I189c3d5224ec58ad63851d173b94204b273c3696
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
benchmarks/QPI/compute.yaml [deleted file]
qtip/ansible_library/plugins/action/calculate.py
qtip/loader/file.py
qtip/loader/qpi.py
resources/ansible_roles/qtip/tasks/calculate.yml
resources/baselines/compute.json [moved from resources/QPI/compute-baseline.json with 100% similarity]
tests/conftest.py

diff --git a/benchmarks/QPI/compute.yaml b/benchmarks/QPI/compute.yaml
deleted file mode 100644 (file)
index 78a2d32..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-##############################################################################
-# Copyright (c) 2016 ZTE Corporation and others.
-#
-# All rights reserved. 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
-##############################################################################
-title: compute
-description: sample performance index of computing
-formula: weighted arithmetic mean
-sections:
-- name: Integer
-  weight: 0.3
-  formula: geometric mean
-  metrics:
-    - dhrystone.yaml
-- name: Float
-  weight: 0.3
-  formula: geometric mean
-  metrics:
-    - whetstone.yaml
-- name: Memory
-  weight: 0.2
-  formula: geometric mean
-  metrics:
-    - ramspeed.yaml
-- name: DPI
-  weight: 0.1
-  formula: geometric mean
-  metrics:
-    - dpi.yaml
-- name: SSL
-  weight: 0.1
-  formula: geometric mean
-  metrics:
-    - ssl.yaml
index 33cda1b..fa45940 100644 (file)
@@ -88,7 +88,7 @@ def calc_qpi(qpi_spec, metrics, sysinfo, qpi_baseline):
         'system_info': sysinfo,
         'sections': section_results,
         'spec': "https://git.opnfv.org/qtip/tree/resources/QPI/compute.yaml",
-        'baseline': "https://git.opnfv.org/qtip/tree/resources/QPI/compute-baseline.json"
+        'baseline': "https://git.opnfv.org/qtip/tree/resources/baselines/compute.json"
     }
 
     return results
index a39e15f..6ef4bf3 100644 (file)
@@ -17,7 +17,7 @@ from qtip.loader.base import BaseLoader
 
 
 ROOT_DIR = path.join(path.dirname(__file__), path.pardir, path.pardir,
-                     'benchmarks')
+                     'resources')
 
 
 class FileLoader(BaseLoader):
index 2a85766..48f52e8 100644 (file)
@@ -9,6 +9,7 @@
 
 from yaml_file import YamlFileLoader
 
+from qtip.base.constant import FormulaName
 from qtip.base.constant import SpecProp
 from qtip.util.formula import Formula
 
@@ -31,5 +32,5 @@ class QPISpec(YamlFileLoader):
 class Section(object):
     def __init__(self, content, paths=None):
         self.name = content[SpecProp.NAME]
-        self.weight = content[SpecProp.WEIGHT]
-        self.formula = Formula(content[SpecProp.FORMULA])
+        self.weight = content.get(SpecProp.WEIGHT, None)
+        self.formula = Formula(content.get(SpecProp.FORMULA, FormulaName.ARITHMETIC_MEAN))
index b07d12f..9444a0e 100644 (file)
@@ -21,6 +21,6 @@
       floating: "{{ qtip_results }}/arithmetic/metrics.json"
     sysinfo: "{{ qtip_results }}/sysinfo/condition.json"
     spec:   "{{ qtip_resources }}/QPI/compute.yaml"
-    baseline: "{{ qtip_resources }}/QPI/compute-baseline.json"
+    baseline: "{{ qtip_resources }}/baselines/compute.json"
     dest: "{{ qtip_results }}/compute.json"
   delegate_to: localhost
index 8e812d6..343f354 100644 (file)
@@ -156,7 +156,7 @@ def qpi_result(section_result, info):
             'system_info': info,
             'sections': [section_result],
             'spec': "https://git.opnfv.org/qtip/tree/resources/QPI/compute.yaml",
-            'baseline': "https://git.opnfv.org/qtip/tree/resources/QPI/compute-baseline.json",
+            'baseline': "https://git.opnfv.org/qtip/tree/resources/baselines/compute.json",
             }