From: Yujun Zhang Date: Tue, 17 Jan 2017 13:58:44 +0000 (+0800) Subject: Code refactoring about doctor QPI X-Git-Tag: danube.1.0~104^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=d728b82cbff33ab7658e8aa0f2e846ae3afe3606;p=qtip.git Code refactoring about doctor QPI - Move sample log files to test data - Move configuration from plugin to plan Change-Id: Iaaf36ab3ce29c2eafe2d75f3524e7a302cc3836d Signed-off-by: Yujun Zhang --- diff --git a/.gitignore b/.gitignore index 7c7892db..64945b8a 100644 --- a/.gitignore +++ b/.gitignore @@ -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 index e69de29b..00000000 diff --git a/opt/plugin/__init__.py b/opt/plugin/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/opt/plugin/doctor/__init__.py b/opt/plugin/doctor/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/opt/plugin/doctor/collector.yaml b/opt/plugin/doctor/collector.yaml deleted file mode 100644 index 40167588..00000000 --- a/opt/plugin/doctor/collector.yaml +++ /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() 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 index e69de29b..00000000 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 index 00000000..545dfd7f --- /dev/null +++ b/tests/data/external/doctor-verify-apex-sample-master/README @@ -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/opt/plugin/doctor/sample/doctor-verify-apex-sample-master/consumer.log b/tests/data/external/doctor-verify-apex-sample-master/consumer.log similarity index 100% rename from opt/plugin/doctor/sample/doctor-verify-apex-sample-master/consumer.log rename to tests/data/external/doctor-verify-apex-sample-master/consumer.log diff --git a/opt/plugin/doctor/sample/doctor-verify-apex-sample-master/disable_network.log b/tests/data/external/doctor-verify-apex-sample-master/disable_network.log similarity index 100% rename from opt/plugin/doctor/sample/doctor-verify-apex-sample-master/disable_network.log rename to tests/data/external/doctor-verify-apex-sample-master/disable_network.log diff --git a/opt/plugin/doctor/sample/doctor-verify-apex-sample-master/doctor_consumer.log b/tests/data/external/doctor-verify-apex-sample-master/doctor_consumer.log similarity index 100% rename from opt/plugin/doctor/sample/doctor-verify-apex-sample-master/doctor_consumer.log rename to tests/data/external/doctor-verify-apex-sample-master/doctor_consumer.log diff --git a/opt/plugin/doctor/sample/doctor-verify-apex-sample-master/doctor_inspector.log b/tests/data/external/doctor-verify-apex-sample-master/doctor_inspector.log similarity index 100% rename from opt/plugin/doctor/sample/doctor-verify-apex-sample-master/doctor_inspector.log rename to tests/data/external/doctor-verify-apex-sample-master/doctor_inspector.log diff --git a/opt/plugin/doctor/sample/doctor-verify-apex-sample-master/doctor_monitor.log b/tests/data/external/doctor-verify-apex-sample-master/doctor_monitor.log similarity index 100% rename from opt/plugin/doctor/sample/doctor-verify-apex-sample-master/doctor_monitor.log rename to tests/data/external/doctor-verify-apex-sample-master/doctor_monitor.log diff --git a/opt/plugin/doctor/sample/doctor-verify-apex-sample-master/functest-doctor.log b/tests/data/external/doctor-verify-apex-sample-master/functest-doctor.log similarity index 100% rename from opt/plugin/doctor/sample/doctor-verify-apex-sample-master/functest-doctor.log rename to tests/data/external/doctor-verify-apex-sample-master/functest-doctor.log diff --git a/opt/plugin/doctor/sample/doctor-verify-apex-sample-master/inspector.log b/tests/data/external/doctor-verify-apex-sample-master/inspector.log similarity index 100% rename from opt/plugin/doctor/sample/doctor-verify-apex-sample-master/inspector.log rename to tests/data/external/doctor-verify-apex-sample-master/inspector.log diff --git a/opt/plugin/doctor/sample/doctor-verify-apex-sample-master/monitor.log b/tests/data/external/doctor-verify-apex-sample-master/monitor.log similarity index 100% rename from opt/plugin/doctor/sample/doctor-verify-apex-sample-master/monitor.log rename to tests/data/external/doctor-verify-apex-sample-master/monitor.log diff --git a/opt/plugin/doctor/sample/doctor-verify-apex-sample-master/ssh_tunnel.192.0.2.6.log b/tests/data/external/doctor-verify-apex-sample-master/ssh_tunnel.192.0.2.6.log similarity index 100% rename from opt/plugin/doctor/sample/doctor-verify-apex-sample-master/ssh_tunnel.192.0.2.6.log rename to tests/data/external/doctor-verify-apex-sample-master/ssh_tunnel.192.0.2.6.log diff --git a/opt/plugin/doctor/sample/doctor-verify-apex-sample-master/ssh_tunnel.192.0.2.8.log b/tests/data/external/doctor-verify-apex-sample-master/ssh_tunnel.192.0.2.8.log similarity index 100% rename from opt/plugin/doctor/sample/doctor-verify-apex-sample-master/ssh_tunnel.192.0.2.8.log rename to tests/data/external/doctor-verify-apex-sample-master/ssh_tunnel.192.0.2.8.log diff --git a/opt/plugin/doctor/sample/doctor-verify-apex-sample-master/ssh_tunnel.192.0.2.9.log b/tests/data/external/doctor-verify-apex-sample-master/ssh_tunnel.192.0.2.9.log similarity index 100% rename from opt/plugin/doctor/sample/doctor-verify-apex-sample-master/ssh_tunnel.192.0.2.9.log rename to tests/data/external/doctor-verify-apex-sample-master/ssh_tunnel.192.0.2.9.log diff --git a/tests/data/opt/plan/doctor.yaml b/tests/data/opt/plan/doctor.yaml new file mode 100644 index 00000000..48b4c955 --- /dev/null +++ b/tests/data/opt/plan/doctor.yaml @@ -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() 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