aboutsummaryrefslogtreecommitdiffstats
path: root/qtip/loader/module.py
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2017-02-09 10:12:39 +0800
committerYujun Zhang <zhang.yujunz@zte.com.cn>2017-02-15 06:54:40 +0800
commit0f3ad6f2db26fb91190e47c89f77fb59b7601b84 (patch)
tree8b855519dfb53d0abdd96a6eb93f3463df35817b /qtip/loader/module.py
parent6add7fcac82f9b807e71fe84d16c673682d82327 (diff)
Refactoring collector initialization in plan loader
- move ClassProps to module - collectors should be array in plan definition Change-Id: I37d85dbc977c91aa1bb81de45b5e1c41660e6d1f Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
Diffstat (limited to 'qtip/loader/module.py')
-rw-r--r--qtip/loader/module.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/qtip/loader/module.py b/qtip/loader/module.py
new file mode 100644
index 00000000..05cb1b76
--- /dev/null
+++ b/qtip/loader/module.py
@@ -0,0 +1,19 @@
+##############################################################################
+# Copyright (c) 2017 ZTE Corp 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
+##############################################################################
+
+
+from qtip.collector.logfile import LogfileCollector
+
+
+# TODO(yujunz) more elegant way to load module dynamically
+def load_collector(type_name):
+ if type_name == LogfileCollector.TYPE:
+ return LogfileCollector
+ else:
+ raise Exception("Invalid collector type: {}".format(type_name))