compute capacity description adjustment and HT check added 89/21089/2
authorMatthewLi <matthew.lijun@huawei.com>
Wed, 14 Sep 2016 07:18:19 +0000 (03:18 -0400)
committerMatthewLi <matthew.lijun@huawei.com>
Sun, 18 Sep 2016 02:41:13 +0000 (22:41 -0400)
JIRA: YARDSTICK-270

1)description info amended according to really tested
2)hyper-thread status check added

Change-Id: I813a41ff1e55c2d816fa55b773cf6c4bdd2af2bd
Signed-off-by: MatthewLi <matthew.lijun@huawei.com>
samples/computecapacity.yaml
tests/opnfv/test_cases/opnfv_yardstick_tc055.yaml
tests/unit/benchmark/scenarios/compute/test_computecapacity.py
yardstick/benchmark/scenarios/compute/computecapacity.bash

index 006b3ef..ae527d2 100644 (file)
@@ -1,8 +1,12 @@
 ---
 # Sample benchmark task config file
-# Measure compute capacity and scale.
-# Including number of cores, number of threads, available memory size and
-# cache size.
+# compute capacity and scale.
+
+# the results have
+# number of CPUs, number of physical cores in a single CPU
+# number of logical cores, total memory size
+# cache size per CPU, total cache size
+# HT (Hyper-Thread) support status, 1 for open, 0 for close
 
 schema: "yardstick:task:0.1"
 
index 403bc34..54fc965 100644 (file)
@@ -1,7 +1,13 @@
 ---
 # Yardstick TC055 config file
-# Collect hardware specification from /proc/cpuinfo
-# Measure number of cores, number of threads, available memory size and cache size
+# Collect hardware specification from /proc/cpuinfo /proc/meminfo
+# compute capacity and scale.
+
+# the results have
+# number of CPUs, number of physical cores in a single CPU
+# number of logical cores, total memory size
+# cache size per CPU, total cache size
+# HT (Hyper-Thread) support status, 1 for open, 0 for close
 
 schema: "yardstick:task:0.1"
 {% set host = host or "node5.yardstick-TC055" %}
index 660bb33..da06b5d 100644 (file)
@@ -20,7 +20,7 @@ from yardstick.benchmark.scenarios.compute import computecapacity
 
 SAMPLE_OUTPUT = '{"Cpu_number": "2", "Core_number": "24",\
  "Memory_size": "263753976 kB", "Thread_number": "48",\
- "Cache_size": "30720 KB"}'
+ "Cache_size": "30720 KB", "HT_Open": "0"}'
 
 
 @mock.patch('yardstick.benchmark.scenarios.compute.computecapacity.ssh')
index 98d4b8f..68741a9 100644 (file)
@@ -9,13 +9,15 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
-# Measure compute capacity and scale of a host
+# compute capacity and scale of a host
 
 set -e
 
 # run capacity test
 run_capacity()
 {
+    #parameter used for HT(Hyper-Thread) check
+    HT_Para=2
     # Number of CPUs
     CPU=$(grep 'physical id' /proc/cpuinfo | sort -u | wc -l)
     # Number of physical cores in a single CPU
@@ -31,6 +33,12 @@ run_capacity()
     CACHE=$(grep 'cache size' /proc/cpuinfo | sort -u)
     CA=$(echo $CACHE | awk '/ /{printf "%s", $4}')
     CACHES=$[$CA * $CPU]
+    HT_Value=$[$HT_Para * $CORES]
+    if [ $HT_Value -eq $THREAD ]; then
+        HT_OPEN=1
+    else
+        HT_OPEN=0
+    fi
 }
 
 # write the result to stdout in json format
@@ -41,7 +49,8 @@ output_json()
         \"Core_number\":\"$CORES\", \
         \"Thread_number\":\"$THREAD\", \
         \"Memory_size\": \"$ME\", \
-        \"Cache_size\": \"$CACHES KB\" \
+        \"Cache_size\": \"$CACHES KB\", \
+        \"HT_Open\": \"$HT_OPEN\" \
     }"
 }