@name 获取项目负载信息 @author hwliang<2021-08-12> @param get { project_name: string<项目名称> } @return dict
(self, get=None, project_name=None)
| 2129 | return result |
| 2130 | |
| 2131 | def get_project_load_info(self, get=None, project_name=None): |
| 2132 | ''' |
| 2133 | @name 获取项目负载信息 |
| 2134 | @author hwliang<2021-08-12> |
| 2135 | @param get<dict_obj>{ |
| 2136 | project_name: string<项目名称> |
| 2137 | } |
| 2138 | @return dict |
| 2139 | ''' |
| 2140 | if get: project_name = get.project_name.strip() |
| 2141 | load_info = {} |
| 2142 | # id_file = "{}/{}.pid".format(self._springboot_pid_path,project_name) |
| 2143 | project_info = self.get_project_find(project_name) |
| 2144 | if not project_info: return load_info |
| 2145 | if not 'project_config' in project_info: return load_info |
| 2146 | if not 'pids' in project_info['project_config']: return load_info |
| 2147 | pid_file = project_info['project_config']['pids'] |
| 2148 | if not os.path.exists(pid_file): return load_info |
| 2149 | try: |
| 2150 | pid = int(public.readFile(pid_file)) |
| 2151 | except: |
| 2152 | return load_info |
| 2153 | pids = self.get_project_pids(pid = pid) |
| 2154 | if not pids: return load_info |
| 2155 | for i in pids: |
| 2156 | process_info = self.get_process_info_by_pid(i) |
| 2157 | if process_info: load_info[i] = process_info |
| 2158 | return load_info |
| 2159 | |
| 2160 | def get_duli_load_info(self, get=None, project_name=None, bt_tomcat_web='/www/server/bt_tomcat_web/', neizhi=False): |
| 2161 | ''' |
no test coverage detected