Compare commits
3 Commits
857d26d092
...
a9adfa5cb1
Author | SHA1 | Date |
---|---|---|
BryantHe | a9adfa5cb1 | |
BryantHe | d2025c628e | |
BryantHe | 45e8b692f0 |
|
@ -1,3 +1,4 @@
|
||||||
|
import importlib
|
||||||
import inspect
|
import inspect
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
@ -318,10 +319,13 @@ def metric_config_gen(module, class_name_str):
|
||||||
"""
|
"""
|
||||||
from statsd.client.timer import Timer
|
from statsd.client.timer import Timer
|
||||||
|
|
||||||
|
import sys
|
||||||
|
click.echo(f'sys.path: {sys.path}')
|
||||||
|
|
||||||
# Extract information of statsd config from the class of nameko service
|
# Extract information of statsd config from the class of nameko service
|
||||||
dest_dir = module.split('.')[0]
|
dest_dir = module.split('.')[0]
|
||||||
file_name = module.split('.')[-1]
|
file_name = module.split('.')[-1]
|
||||||
_module = __import__(module)
|
_module = importlib.import_module(name='.'+file_name, package=dest_dir)
|
||||||
config_list = []
|
config_list = []
|
||||||
for class_name in class_name_str.split(','):
|
for class_name in class_name_str.split(','):
|
||||||
members = inspect.getmembers(getattr(getattr(_module, file_name), class_name), predicate=inspect.isfunction)
|
members = inspect.getmembers(getattr(getattr(_module, file_name), class_name), predicate=inspect.isfunction)
|
||||||
|
|
Loading…
Reference in New Issue