Code refactoring about doctor QPI 29/27129/7
authorYujun Zhang <zhang.yujunz@zte.com.cn>
Tue, 17 Jan 2017 13:58:44 +0000 (21:58 +0800)
committerYujun Zhang <zhang.yujunz@zte.com.cn>
Mon, 23 Jan 2017 04:17:27 +0000 (12:17 +0800)
- Move sample log files to test data
- Move configuration from plugin to plan

Change-Id: Iaaf36ab3ce29c2eafe2d75f3524e7a302cc3836d
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
19 files changed:
.gitignore
opt/__init__.py [deleted file]
opt/plugin/__init__.py [deleted file]
opt/plugin/doctor/__init__.py [deleted file]
opt/plugin/doctor/collector.yaml [deleted file]
opt/plugin/doctor/sample/__init__.py [deleted file]
tests/data/external/doctor-verify-apex-sample-master/README [new file with mode: 0644]
tests/data/external/doctor-verify-apex-sample-master/consumer.log [moved from opt/plugin/doctor/sample/doctor-verify-apex-sample-master/consumer.log with 100% similarity]
tests/data/external/doctor-verify-apex-sample-master/disable_network.log [moved from opt/plugin/doctor/sample/doctor-verify-apex-sample-master/disable_network.log with 100% similarity]
tests/data/external/doctor-verify-apex-sample-master/doctor_consumer.log [moved from opt/plugin/doctor/sample/doctor-verify-apex-sample-master/doctor_consumer.log with 100% similarity]
tests/data/external/doctor-verify-apex-sample-master/doctor_inspector.log [moved from opt/plugin/doctor/sample/doctor-verify-apex-sample-master/doctor_inspector.log with 100% similarity]
tests/data/external/doctor-verify-apex-sample-master/doctor_monitor.log [moved from opt/plugin/doctor/sample/doctor-verify-apex-sample-master/doctor_monitor.log with 100% similarity]
tests/data/external/doctor-verify-apex-sample-master/functest-doctor.log [moved from opt/plugin/doctor/sample/doctor-verify-apex-sample-master/functest-doctor.log with 100% similarity]
tests/data/external/doctor-verify-apex-sample-master/inspector.log [moved from opt/plugin/doctor/sample/doctor-verify-apex-sample-master/inspector.log with 100% similarity]
tests/data/external/doctor-verify-apex-sample-master/monitor.log [moved from opt/plugin/doctor/sample/doctor-verify-apex-sample-master/monitor.log with 100% similarity]
tests/data/external/doctor-verify-apex-sample-master/ssh_tunnel.192.0.2.6.log [moved from opt/plugin/doctor/sample/doctor-verify-apex-sample-master/ssh_tunnel.192.0.2.6.log with 100% similarity]
tests/data/external/doctor-verify-apex-sample-master/ssh_tunnel.192.0.2.8.log [moved from opt/plugin/doctor/sample/doctor-verify-apex-sample-master/ssh_tunnel.192.0.2.8.log with 100% similarity]
tests/data/external/doctor-verify-apex-sample-master/ssh_tunnel.192.0.2.9.log [moved from opt/plugin/doctor/sample/doctor-verify-apex-sample-master/ssh_tunnel.192.0.2.9.log with 100% similarity]
tests/data/opt/plan/doctor.yaml [new file with mode: 0644]

index 7c7892d..64945b8 100644 (file)
@@ -71,5 +71,5 @@ target/
 AUTHORS
 ChangeLog
 
-# unignore sample logfiles
-!/opt/plugin/doctor/sample/*/*
+# unignore external data
+!/tests/data/**/*
diff --git a/opt/__init__.py b/opt/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/opt/plugin/__init__.py b/opt/plugin/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/opt/plugin/doctor/__init__.py b/opt/plugin/doctor/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/opt/plugin/doctor/collector.yaml b/opt/plugin/doctor/collector.yaml
deleted file mode 100644 (file)
index 4016758..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-# collector configuration for doctor verification job
-# collect performance data from log files
-collector: logfile
-# transform collected data into timeline
-transformer: timeline
-logfiles:
-  - filename: doctor_consumer.log
-  # 2016-12-28 03:16:05,630 consumer.py 26 INFO   doctor consumer notified at 1482894965.63
-    - match: doctor consumer notified at \d+(\.\d+)?$
-      checkpoint: notified consumer
-  - filename: doctor_inspector.log
-  # 2016-12-28 03:16:05,299 inspector.py 76 INFO   event posted at 1482894965.3
-  # 2016-12-28 03:16:05,299 inspector.py 56 INFO   doctor mark vm(<Server: doctor_vm1>) error at 1482894965.3
-  # 2016-12-28 03:16:05,506 inspector.py 66 INFO   doctor mark host(overcloud-novacompute-1.ool-virtual1) down at 1482894965.51
-    - match: event posted at \d+(\.\d+)?$
-      checkpoint: posted event
-    - match: doctor mark vm\(.*\) error at \d+(\.\d+)?$
-      checkpoint: marked VM error
-    - match: doctor mark host\(.*\) down at \d+(\.\d+)?$
-      checkpoint: marked host down
-  - filename: disable_network.log
-  # doctor set host down at 1482894965.164096803
-    - match: doctor set host down at \d+(\.\d+)?$
-    - checkpoint: set host down
diff --git a/opt/plugin/doctor/sample/__init__.py b/opt/plugin/doctor/sample/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/tests/data/external/doctor-verify-apex-sample-master/README b/tests/data/external/doctor-verify-apex-sample-master/README
new file mode 100644 (file)
index 0000000..545dfd7
--- /dev/null
@@ -0,0 +1,3 @@
+Sample log files downloaded from
+
+- https://build.opnfv.org/ci/job/doctor-verify-apex-sample-master/37/artifact/
diff --git a/tests/data/opt/plan/doctor.yaml b/tests/data/opt/plan/doctor.yaml
new file mode 100644 (file)
index 0000000..48b4c95
--- /dev/null
@@ -0,0 +1,37 @@
+name: doctor performance profiling
+description: create performance profile for OPNFV doctor notification time
+info:
+  facility: local
+  engineer: local
+config:
+  driver: sample
+  collector:
+    - name: logfile
+      logs:
+        - filename: doctor_consumer.log
+          # 2016-12-28 03:16:05,630 consumer.py 26 INFO   doctor consumer notified at 1482894965.63
+          patterns:
+            - match: 'doctor consumer notified at \d+(\.\d+)?$'
+              capture: notified consumer
+        - filename: doctor_inspector.log
+          # 2016-12-28 03:16:05,299 inspector.py 76 INFO   event posted at 1482894965.3
+          # 2016-12-28 03:16:05,299 inspector.py 56 INFO   doctor mark vm(<Server: doctor_vm1>) error at 1482894965.3
+          # 2016-12-28 03:16:05,506 inspector.py 66 INFO   doctor mark host(overcloud-novacompute-1.ool-virtual1) down at 1482894965.51
+          patterns:
+            - match: 'event posted at \d+(\.\d+)?$'
+              capture: posted event
+            - match: 'doctor mark vm\(.*\) error at \d+(\.\d+)?$'
+              capture: marked VM error
+            - match: 'doctor mark host\(.*\) down at \d+(\.\d+)?$'
+              capture: marked host down
+        - filename: disable_network.log
+          # doctor set host down at 1482894965.164096803
+          patterns:
+            - match: 'doctor set host down at \d+(\.\d+)?$'
+              capture: set host down
+  reporter:
+    name: console
+    # transform collected data into timeline
+    transformer: timeline
+QPIs:
+  - fake-qpi.yaml