def __init__(self, ac, app_id, app_name, serviceType=PHP): assert ac.collector_type == SUPPORT_GRPC super().__init__(app_id, app_name) self.agent_meta = [('starttime', str(ac.startTimestamp)), ('agentid', app_id), ('applicationname', app_name)] self.startTimeStamp = ac.startTimestamp self.max_pending_sz = ac.max_pending_size self.agent_addr = ac.CollectorAgentIp + ':' + str(ac.CollectorAgentPort) self.stat_addr = ac.CollectorStatIp + ':' + str(ac.CollectorSpanPort) self.span_addr = ac.CollectorSpanIp + ':' + str(ac.CollectorSpanPort) import os self.agentHost = AgentHost() self.max_span_sender_size = 2 self.span_sender_list = [] self.sender_index = 0 self._startSpanSender() self.agent_client = GrpcAgent(self.agentHost.hostname, self.agentHost.ip, ac.getWebPort(), os.getpid(), self.agent_addr, self.agent_meta) self.meta_client = GrpcMeta(self.agent_addr, self.agent_meta) self.agent_client.start() self.meta_client.start() self.span_factory = GrpcSpanFactory(self)
def __init__(self, ac, app_id, app_name, serviceType): assert ac.collector_type == SUPPORT_GRPC super().__init__(app_id, app_name) self.agent_meta = [('starttime', str(ac.startTimestamp)), ('agentid', app_id), ('applicationname', app_name)] self.startTimeStamp = ac.startTimestamp self.service_type = serviceType self.max_pending_sz = ac.max_pending_size self.agent_addr = ac.CollectorAgentIp + ':' + str( ac.CollectorAgentPort) self.stat_addr = ac.CollectorStatIp + ':' + str(ac.CollectorStatPort) self.span_addr = ac.CollectorSpanIp + ':' + str(ac.CollectorSpanPort) self.web_port = ac.getWebPort() self.agentHost = AgentHost() self.max_span_sender_size = 2 self.sender_index = 0
def scanLocalInfo(self): ah = AgentHost() self.agentInfo.hostname = ah.hostname self.agentInfo.ip = ah.ip self.agentInfo.ports = self.ac.getWebPort()