From 9222ecb462099f667d78494f4886d6c84f8a2310 Mon Sep 17 00:00:00 2001 From: Yujun Zhang Date: Thu, 20 Apr 2017 20:58:13 +0800 Subject: Reorganize benchmarking tasks into ansible roles which helps to - group task with related templates and variables - simplify the main playbook to improve readability See: http://docs.ansible.com/ansible/playbooks_roles.html Change-Id: I9d3180edaac83ee9dba85ce5ac14ff574af7a905 Signed-off-by: Yujun Zhang --- resources/metric/inxi.yaml | 44 ------------------------- resources/metric/nDPI.yaml | 60 --------------------------------- resources/metric/openssl.yaml | 54 ------------------------------ resources/metric/ramspeed.yaml | 75 ------------------------------------------ 4 files changed, 233 deletions(-) delete mode 100644 resources/metric/inxi.yaml delete mode 100644 resources/metric/nDPI.yaml delete mode 100644 resources/metric/openssl.yaml delete mode 100644 resources/metric/ramspeed.yaml (limited to 'resources/metric') diff --git a/resources/metric/inxi.yaml b/resources/metric/inxi.yaml deleted file mode 100644 index 47eb2e73..00000000 --- a/resources/metric/inxi.yaml +++ /dev/null @@ -1,44 +0,0 @@ -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -- name: install inxi - Command line system information script for console and IRC - package: - name: inxi - state: present - -- name: check hardware information with inxi - command: inxi -b -c0 -n - register: inxi_out - -# TODO(yujunz) normalize system information, test condition and performance metrics for future data mining -# e.g. convert "2 Deca core Intel Xeon E5-2650 v3s (-HT-MCP-SMP-) speed/max: 1200/3000 MHz" to -# --- -# processor: -# id: -# vendor: Intel -# product_family: Xeon -# processor_number: E5-2650 v3s -# number_of_cores: 2 -# number_of_threads: None # set `None` when data is not available -# base_frequency_mhz: 1200 -# max_turbo_frequency_mhz: 3000 -# cache_mb: None -- name: collect system information from inxi - collect: - string: "{{ inxi_out.stdout }}" - patterns: - - '.+\s+Host:\s+(?P.+)\sKernel' - - '.+\sMemory:\s+(?P.+MB)\s' - - '^CPU\(s\):\s+(?P.+)' - - '.+\sDistro:\s+(?P.+)' - - '.+\sKernel:\s+(?P.+)\sConsole' - - '.+\s+HDD Total Size:\s+(?P.+)\s' - - '.+\sproduct:\s+(?P.+)\sv' - dump: 'inix.log' - register: system_info diff --git a/resources/metric/nDPI.yaml b/resources/metric/nDPI.yaml deleted file mode 100644 index b3e7259f..00000000 --- a/resources/metric/nDPI.yaml +++ /dev/null @@ -1,60 +0,0 @@ -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - - -- name: prepare sample pcap file - get_url: - url: "http://artifacts.opnfv.org/qtip/utilities/test.pcap" - dest: "{{ qtip_cache }}/{{ nDPI_file }}" - # validate_certs: no # required when using proxy for https - run_once: yes - delegate_to: localhost - -- name: making nDPI temporary directory - file: - path: "{{ nDPI_cwd }}" - state: directory - -- name: clone nDPI - git: - repo: https://github.com/ntop/nDPI.git - dest: "{{ nDPI_cwd }}" - depth: 1 - update: no - -- name: build nDPI library - command: '{{ item }}' - with_items: - - ./autogen.sh - - ./configure - - make - args: - chdir: "{{ nDPI_cwd }}" - creates: example/ndpiReader - -- name: copy sample packet file - copy: - src: "{{ qtip_cache}}/{{ nDPI_file }}" - dest: "{{ nDPI_cwd }}/example/{{ nDPI_file }}" - -- name: - command: "./ndpiReader -i {{ nDPI_file }}" - args: - chdir: "{{ nDPI_cwd }}/example/" - register: nDPI_out - -- name: collect DPI metrics from nDPI - collect: - string: "{{ nDPI_out.stdout }}" - patterns: - # nDPI throughput: 1.46 M pps / 13.69 Gb/sec - # TODO(yujunz) convert "M pps" and "K pps" to number - - 'nDPI throughput:\s+?(?P\d+.\d+.*) \/ (?P\d+.\d+.*)$' - dump: 'nDPI.log' - register: dpi_metrics diff --git a/resources/metric/openssl.yaml b/resources/metric/openssl.yaml deleted file mode 100644 index 2dda0e33..00000000 --- a/resources/metric/openssl.yaml +++ /dev/null @@ -1,54 +0,0 @@ -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -- name: install openssl - Cryptography and SSL/TLS Toolkit - package: - name: openssl - state: present - -- name: RSA signatures speed measurement - command: openssl speed rsa - register: openssl_rsa_log - -#- name: AES speed measurement -# command: openssl speed -evp aes-128-cbc -# register: openssl_aes_log - -- name: collect ssl metrics from openssl - collect: - string: "{{ openssl_rsa_log.stdout }}" - patterns: - - |- - ^rsa\s+512\sbits\s.+\s+ - ?(?P\d+\.\d)\s+ - ?(?P\d+\.\d)$ - - |- - ^rsa\s+1024\sbits\s.+\s+ - ?(?P\d+\.\d)\s+ - ?(?P\d+\.\d)$ - - |- - ^rsa\s+2048\sbits\s.+\s+ - ?(?P\d+\.\d)\s+ - ?(?P\d+\.\d)$ - - |- - ^rsa\s+4096\sbits\s.+\s+ - ?(?P\d+\.\d)\s+ - ?(?P\d+\.\d)$ - dump: openssl_rsa_log - register: openssl_rsa_metrics - -# - filename: AES-128-CBC_dump -# grep: -# - |- -# ^aes-128-cbc\s+ -# ?(?P\d+\.\w+)\s+ -# ?(?P\d+\.\w+)\s+ -# ?(?P\d+\.\w+)\s+ -# ?(?P\d+\.\w+)\s+ -# ?(?P\d+\.\w+)$ diff --git a/resources/metric/ramspeed.yaml b/resources/metric/ramspeed.yaml deleted file mode 100644 index 6473d576..00000000 --- a/resources/metric/ramspeed.yaml +++ /dev/null @@ -1,75 +0,0 @@ -############################################################################## -# Copyright (c) 2017 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 -############################################################################## - -- name: making ramspeed working directory - file: - path: "{{ cwd }}" - state: directory - tags: [setup] - -- name: download ramspeed/ramsmp - unarchive: - src: http://www.alasir.com/software/ramspeed/ramsmp-3.5.0.tar.gz - dest: "{{ cwd }}" - remote_src: yes - tags: [setup] - -- name: build ramsmp - command: ./build.sh - args: - chdir: "{{ cwd }}/ramsmp-3.5.0" - creates: ramsmp - tags: [setup] - -- name: intmem benchmarking - command: ./ramsmp -b 3 -l 5 -p 1 - args: - chdir: "{{ cwd }}/ramsmp-3.5.0" - register: ramsmp_intmem_out - tags: [run] - -- name: floatmem benchmarking - command: ./ramsmp -b 6 -l 5 -p 1 - args: - chdir: "{{ cwd }}/ramsmp-3.5.0" - register: ramsmp_floatmem_out - tags: [run] - -- name: collect integer memory metrics from ramspeed - collect: - string: "{{ ramsmp_intmem_out.stdout }}" - patterns: - - '^INTEGER\s+BatchRun\s+Copy:\s+?(?P\d+\.\d+)\sMB/s$' - - '^INTEGER\s+BatchRun\s+Scale:\s+?(?P\d+\.\d+)\sMB/s$' - - '^INTEGER\s+BatchRun\s+Add:\s+?(?P\d+\.\d+)\sMB/s$' - - '^INTEGER\s+BatchRun\s+Triad:\s+?(?P\d+\.\d+)\sMB/s$' - - '^INTEGER\s+BatchRun\s+AVERAGE:\s+?(?P\d+\.\d+)\sMB/s$' - dump: 'ramsmp-intmem.log' - register: intmem_metrics - tags: [collect] - -- name: collect float memory metrics from ramspeed - collect: - string: "{{ ramsmp_floatmem_out.stdout }}" - patterns: - - '^FL-POINT\s+BatchRun\s+Copy:\s+?(?P\d+\.\d+)\sMB/s$' - - '^FL-POINT\s+BatchRun\s+Scale:\s+?(?P\d+\.\d+)\sMB/s$' - - '^FL-POINT\s+BatchRun\s+Add:\s+?(?P\d+\.\d+)\sMB/s$' - - '^FL-POINT\s+BatchRun\s+Triad:\s+?(?P\d+\.\d+)\sMB/s$' - - '^FL-POINT\s+BatchRun\s+AVERAGE:\s+?(?P\d+\.\d+)\sMB/s$' - dump: 'ramsmp-floatmem.log' - register: floatmem_metrics - tags: [collect] - -- name: create memory metrics report - template: - src: "{{ qtip_resources }}/template/mem-metrics.j2" - dest: "{{ qtip_reports }}/mem-metrics" - delegate_to: localhost - tags: [report] -- cgit 1.2.3-korg