def start(): global __started if __started: return __started = True flag = False try: from gevent import monkey flag = monkey.is_module_patched("socket") except ModuleNotFoundError: logger.debug( "it was found that no gevent was used, if you don't use, please ignore." ) if flag: import grpc.experimental.gevent as grpc_gevent grpc_gevent.init_gevent() loggings.init() config.finalize() __init() atexit.register(__fini) if (hasattr(os, 'register_at_fork')): os.register_at_fork(before=__fork_before, after_in_parent=__fork_after_in_parent, after_in_child=__fork_after_in_child)
def start(): global __started if __started: raise RuntimeError('the agent can only be started once') from skywalking import loggings loggings.init() __started = True __init() __heartbeat_thread.start() __report_thread.start()
def start(): global __started if __started: raise RuntimeError('the agent can only be started once') loggings.init() config.finalize() __started = True __init() __heartbeat_thread.start() __report_thread.start() atexit.register(__fini)
def start(): flag = False try: from gevent import monkey flag = monkey.is_module_patched("socket") except ModuleNotFoundError: logger.debug( "it was found that no gevent was used, if you don't use, please ignore." ) if flag: import grpc.experimental.gevent as grpc_gevent grpc_gevent.init_gevent() global __started if __started: raise RuntimeError('the agent can only be started once') loggings.init() config.finalize() __started = True __init() __heartbeat_thread.start() __report_thread.start() atexit.register(__fini)
# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # import time from collections import namedtuple from enum import Enum from typing import List from skywalking import loggings loggings.init() class Component(Enum): Unknown = 0 Http = 49 Flask = 7001 class Layer(Enum): Unknown = 0 Database = 1 RPCFramework = 2 Http = 3 MQ = 4 Cache = 5