mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 20:09:57 +08:00
fix unit test and code style changes
This commit is contained in:
parent
cf6df18446
commit
2ab0e0eb93
@ -25,6 +25,7 @@ def app(request):
|
||||
yield app
|
||||
|
||||
db.drop_all()
|
||||
app.stop()
|
||||
# shutil.rmtree(tpath)
|
||||
|
||||
|
||||
|
@ -25,8 +25,8 @@ def create_app(testing_config=None):
|
||||
from mishards.grpc_utils import GrpcSpanDecorator
|
||||
from tracer.factory import TracerFactory
|
||||
tracer = TracerFactory(config.TRACING_PLUGIN_PATH).create(config.TRACING_TYPE,
|
||||
settings.TracingConfig,
|
||||
span_decorator=GrpcSpanDecorator())
|
||||
settings.TracingConfig,
|
||||
span_decorator=GrpcSpanDecorator())
|
||||
|
||||
from mishards.routings import RouterFactory
|
||||
router = RouterFactory.new_router(config.ROUTER_CLASS_NAME, connect_mgr)
|
||||
|
@ -2,6 +2,7 @@ import os
|
||||
import logging
|
||||
from functools import partial
|
||||
from pluginbase import PluginBase
|
||||
from tracer import Tracer
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -11,7 +12,8 @@ get_path = partial(os.path.join, here)
|
||||
|
||||
PLUGIN_PACKAGE_NAME = 'tracer.plugins'
|
||||
plugin_base = PluginBase(package=PLUGIN_PACKAGE_NAME,
|
||||
searchpath=[get_path('./plugins')])
|
||||
searchpath=[get_path('./plugins')])
|
||||
|
||||
|
||||
class TracerFactory(object):
|
||||
def __init__(self, searchpath=None):
|
||||
@ -19,8 +21,8 @@ class TracerFactory(object):
|
||||
self.tracer_map = {}
|
||||
searchpath = searchpath if searchpath else []
|
||||
searchpath = [searchpath] if isinstance(searchpath, str) else searchpath
|
||||
self.source = plugin_base.make_plugin_source(
|
||||
searchpath=searchpath, identifier=self.__class__.__name__)
|
||||
self.source = plugin_base.make_plugin_source(searchpath=searchpath,
|
||||
identifier=self.__class__.__name__)
|
||||
|
||||
for plugin_name in self.source.list_plugins():
|
||||
plugin = self.source.load_plugin(plugin_name)
|
||||
@ -34,10 +36,10 @@ class TracerFactory(object):
|
||||
return self.tracer_map.get(name, None)
|
||||
|
||||
def create(self,
|
||||
tracer_type,
|
||||
tracer_config,
|
||||
span_decorator=None,
|
||||
**kwargs):
|
||||
tracer_type,
|
||||
tracer_config,
|
||||
span_decorator=None,
|
||||
**kwargs):
|
||||
if not tracer_type:
|
||||
return Tracer()
|
||||
plugin_class = self.plugin(tracer_type.lower())
|
||||
|
@ -8,6 +8,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
PLUGIN_NAME = __file__
|
||||
|
||||
|
||||
class JaegerFactory:
|
||||
name = 'jaeger'
|
||||
@classmethod
|
||||
|
Loading…
Reference in New Issue
Block a user