From cdb8e1be12b724e9f68c7e46c9a653ec37c502cb Mon Sep 17 00:00:00 2001 From: Yujun Zhang Date: Sun, 5 Feb 2017 12:24:30 +0800 Subject: Implement logfile collector and grep parser JIRA: QTIP-207 JIRA: QTIP-208 Change-Id: Icc14d3097fb305e59df716636ef87504490c9d1b Signed-off-by: Yujun Zhang --- tests/data/benchmarks/QPI/fake-qpi.yaml | 9 ------- tests/data/benchmarks/QPI/fake_qpi.yaml | 9 +++++++ tests/data/benchmarks/plan/doctor.yaml | 44 ++++++++++++++----------------- tests/data/benchmarks/plan/fake-plan.yaml | 10 ------- tests/data/fake.log | 9 +++++++ 5 files changed, 38 insertions(+), 43 deletions(-) delete mode 100644 tests/data/benchmarks/QPI/fake-qpi.yaml create mode 100644 tests/data/benchmarks/QPI/fake_qpi.yaml delete mode 100644 tests/data/benchmarks/plan/fake-plan.yaml create mode 100644 tests/data/fake.log (limited to 'tests/data') diff --git a/tests/data/benchmarks/QPI/fake-qpi.yaml b/tests/data/benchmarks/QPI/fake-qpi.yaml deleted file mode 100644 index aa1097f4..00000000 --- a/tests/data/benchmarks/QPI/fake-qpi.yaml +++ /dev/null @@ -1,9 +0,0 @@ -name: Fake QPI -description: a fake QPI producing random result -formula: weighted arithmetic mean -sections: -- name: Fake Section - weight: 0.5 - formula: geometric mean - metrics: - - fake-metric.yaml diff --git a/tests/data/benchmarks/QPI/fake_qpi.yaml b/tests/data/benchmarks/QPI/fake_qpi.yaml new file mode 100644 index 00000000..aa1097f4 --- /dev/null +++ b/tests/data/benchmarks/QPI/fake_qpi.yaml @@ -0,0 +1,9 @@ +name: Fake QPI +description: a fake QPI producing random result +formula: weighted arithmetic mean +sections: +- name: Fake Section + weight: 0.5 + formula: geometric mean + metrics: + - fake-metric.yaml diff --git a/tests/data/benchmarks/plan/doctor.yaml b/tests/data/benchmarks/plan/doctor.yaml index f884c606..f8dcf08d 100644 --- a/tests/data/benchmarks/plan/doctor.yaml +++ b/tests/data/benchmarks/plan/doctor.yaml @@ -4,34 +4,30 @@ info: facility: local engineer: local config: - driver: sample collectors: - type: logfile + paths: + - '../../external/doctor-verify-apex-sample-master' logs: - filename: doctor_consumer.log - # 2016-12-28 03:16:05,630 consumer.py 26 INFO doctor consumer notified at 1482894965.63 - grep: - - regex: 'doctor consumer notified at \d+(\.\d+)?$' - capture: notified consumer + parsers: + - type: grep + regex: 'doctor consumer notified at (?P\d+(?:\.\d+)?)$' - 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 - grep: - - regex: 'event posted at \d+(\.\d+)?$' - capture: posted event - - regex: 'doctor mark vm\(.*\) error at \d+(\.\d+)?$' - capture: marked VM error - - regex: 'doctor mark host\(.*\) down at \d+(\.\d+)?$' - capture: marked host down + parsers: + - type: grep + regex: 'event posted at (?P\d+(?:\.\d+)?)$' + - type: grep + regex: 'doctor mark vm\(.*\) error at (?P\d+(?:\.\d+)?)$' + - type: grep + regex: 'doctor mark host\(.*\) down at (?P\d+(?:\.\d+)?)$' - filename: disable_network.log - # doctor set host down at 1482894965.164096803 - grep: - - regex: 'doctor set host down at \d+(\.\d+)?$' - capture: set host down - reporter: - name: console - # transform collected data into timeline - transformer: timeline + parsers: + - type: grep + regex: 'doctor set host down at (?P\d+(?:\.\d+)?)$' + reporters: + - type: console + # transform collected data into timeline + transformer: timeline QPIs: - - fake-qpi.yaml + - fake_qpi.yaml diff --git a/tests/data/benchmarks/plan/fake-plan.yaml b/tests/data/benchmarks/plan/fake-plan.yaml deleted file mode 100644 index 511affd6..00000000 --- a/tests/data/benchmarks/plan/fake-plan.yaml +++ /dev/null @@ -1,10 +0,0 @@ -name: fake plan -description: fake benchmark plan for demonstration and testing -config: - facility: local - engineer: local - driver: sample - collectors: [] - reporter: console -QPIs: - - fake-qpi.yaml diff --git a/tests/data/fake.log b/tests/data/fake.log new file mode 100644 index 00000000..bab71e5a --- /dev/null +++ b/tests/data/fake.log @@ -0,0 +1,9 @@ +Lorem ipsum dolor sit amet, +consectetur adipiscing elit, +sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + +Ut enim ad minim veniam, +quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. + +Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. +Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -- cgit 1.2.3-korg