testcase
This commit is contained in:
parent
d82e25cb12
commit
3ac8c605de
|
|
@ -0,0 +1,15 @@
|
|||
# _*_ coding: utf-8 _*_
|
||||
# @Time :2022/8/18 17:37
|
||||
# @Email :508737091@qq.com
|
||||
# @Author :qiangyanwen
|
||||
# @File :memory_entity.py
|
||||
import datetime
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class SysModel(BaseModel):
|
||||
count: int
|
||||
name: str
|
||||
current_time: str
|
||||
start_time: str
|
||||
|
|
@ -54,3 +54,323 @@
|
|||
2022-08-18 08:53:14 | MainThread:8667215360 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 08:53:14 | MainThread:8667215360 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 08:53:14 | MainThread:8667215360 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 09:02:43 | MainThread:8642758144 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-08-18 09:02:43 | MainThread:8642758144 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-08-18 09:02:44 | MainThread:8642758144 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 09:02:44 | MainThread:8642758144 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 09:02:44 | MainThread:8642758144 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 09:02:44 | MainThread:8642758144 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 09:02:44 | MainThread:8642758144 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 09:02:44 | MainThread:8642758144 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 09:02:44 | MainThread:8642758144 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 09:02:44 | MainThread:8642758144 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 09:02:44 | MainThread:8675984896 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-08-18 09:02:44 | MainThread:8675984896 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-08-18 09:02:44 | MainThread:8675984896 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 09:02:44 | MainThread:8675984896 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 09:02:44 | MainThread:8675984896 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 09:02:44 | MainThread:8675984896 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 09:02:44 | MainThread:8675984896 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 09:02:44 | MainThread:8675984896 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 09:02:44 | MainThread:8675984896 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 09:02:44 | MainThread:8675984896 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 09:02:44 | MainThread:8675984896 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 09:02:44 | MainThread:8675984896 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 09:02:44 | MainThread:8675984896 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 09:02:44 | MainThread:8675984896 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 09:02:44 | MainThread:8675984896 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 09:02:44 | MainThread:8675984896 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 09:02:44 | MainThread:8675984896 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 09:02:44 | MainThread:8675984896 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 09:04:33 | MainThread:8607147520 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-08-18 09:04:33 | MainThread:8607147520 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-08-18 09:04:34 | MainThread:8607147520 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 09:04:34 | MainThread:8607147520 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 09:04:34 | MainThread:8607147520 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 09:04:34 | MainThread:8607147520 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 09:04:34 | MainThread:8607147520 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 09:04:34 | MainThread:8607147520 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 09:04:34 | MainThread:8607147520 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 09:04:34 | MainThread:8607147520 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 09:04:34 | MainThread:8607147520 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 09:04:34 | MainThread:8607147520 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 09:04:34 | MainThread:8607147520 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 09:04:34 | MainThread:8607147520 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 09:04:34 | MainThread:8607147520 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 09:04:34 | MainThread:8607147520 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 09:04:34 | MainThread:8607147520 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 09:04:34 | MainThread:8607147520 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 09:06:43 | MainThread:8601179648 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-08-18 09:06:43 | MainThread:8601179648 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-08-18 09:06:44 | MainThread:8601179648 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 09:06:44 | MainThread:8601179648 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 09:06:44 | MainThread:8601179648 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 09:06:44 | MainThread:8601179648 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 09:06:44 | MainThread:8601179648 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 09:06:44 | MainThread:8601179648 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 09:06:44 | MainThread:8601179648 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 09:06:44 | MainThread:8601179648 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 09:06:44 | MainThread:8601179648 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 09:06:44 | MainThread:8601179648 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 09:06:44 | MainThread:8601179648 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 09:06:44 | MainThread:8601179648 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 09:06:44 | MainThread:8601179648 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 09:06:44 | MainThread:8601179648 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 09:06:44 | MainThread:8601179648 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 09:06:44 | MainThread:8601179648 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:29:54 | MainThread:8668952064 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-08-18 17:29:54 | MainThread:8668952064 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-08-18 17:29:54 | MainThread:8668952064 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:29:54 | MainThread:8668952064 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:29:54 | MainThread:8668952064 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:29:54 | MainThread:8668952064 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:29:54 | MainThread:8668952064 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:29:54 | MainThread:8668952064 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:29:54 | MainThread:8668952064 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:29:54 | MainThread:8668952064 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:29:55 | MainThread:8625325568 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-08-18 17:29:55 | MainThread:8625325568 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-08-18 17:29:55 | MainThread:8625325568 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:29:55 | MainThread:8625325568 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:29:55 | MainThread:8625325568 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:29:55 | MainThread:8625325568 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:29:55 | MainThread:8625325568 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:29:55 | MainThread:8625325568 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:29:55 | MainThread:8625325568 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:29:55 | MainThread:8625325568 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:29:55 | MainThread:8625325568 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:29:55 | MainThread:8625325568 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:29:55 | MainThread:8625325568 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:29:55 | MainThread:8625325568 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:29:55 | MainThread:8625325568 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:29:55 | MainThread:8625325568 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:29:55 | MainThread:8625325568 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:29:55 | MainThread:8625325568 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:33:38 | MainThread:8660911616 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-08-18 17:33:38 | MainThread:8660911616 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-08-18 17:33:39 | MainThread:8660911616 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:33:39 | MainThread:8660911616 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:33:39 | MainThread:8660911616 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:33:39 | MainThread:8660911616 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:33:39 | MainThread:8660911616 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:33:39 | MainThread:8660911616 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:33:39 | MainThread:8660911616 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:33:39 | MainThread:8660911616 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:33:39 | MainThread:8598222336 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-08-18 17:33:39 | MainThread:8598222336 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-08-18 17:33:39 | MainThread:8598222336 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:33:39 | MainThread:8598222336 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:33:39 | MainThread:8598222336 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:33:39 | MainThread:8598222336 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:33:39 | MainThread:8598222336 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:33:39 | MainThread:8598222336 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:33:39 | MainThread:8598222336 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:33:39 | MainThread:8598222336 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:33:39 | MainThread:8598222336 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:33:39 | MainThread:8598222336 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:33:39 | MainThread:8598222336 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:33:39 | MainThread:8598222336 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:33:39 | MainThread:8598222336 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:33:39 | MainThread:8598222336 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:33:39 | MainThread:8598222336 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:33:39 | MainThread:8598222336 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:46:02 | MainThread:8632038912 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-08-18 17:46:02 | MainThread:8632038912 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-08-18 17:46:03 | MainThread:8632038912 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:46:03 | MainThread:8632038912 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:46:03 | MainThread:8632038912 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:46:03 | MainThread:8632038912 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:46:03 | MainThread:8632038912 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:46:03 | MainThread:8632038912 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:46:03 | MainThread:8632038912 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:46:03 | MainThread:8632038912 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:46:03 | MainThread:8665810432 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-08-18 17:46:03 | MainThread:8665810432 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-08-18 17:46:04 | MainThread:8665810432 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:46:04 | MainThread:8665810432 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:46:04 | MainThread:8665810432 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:46:04 | MainThread:8665810432 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:46:04 | MainThread:8665810432 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:46:04 | MainThread:8665810432 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:46:04 | MainThread:8665810432 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:46:04 | MainThread:8665810432 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:46:04 | MainThread:8665810432 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:46:04 | MainThread:8665810432 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:46:04 | MainThread:8665810432 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:46:04 | MainThread:8665810432 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:46:04 | MainThread:8665810432 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:46:04 | MainThread:8665810432 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:46:04 | MainThread:8665810432 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:46:04 | MainThread:8665810432 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:47:12 | MainThread:8607471104 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-08-18 17:47:12 | MainThread:8607471104 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-08-18 17:47:13 | MainThread:8607471104 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:47:13 | MainThread:8607471104 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:47:13 | MainThread:8607471104 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:47:13 | MainThread:8607471104 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:47:13 | MainThread:8607471104 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:47:13 | MainThread:8607471104 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:47:13 | MainThread:8607471104 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:47:13 | MainThread:8607471104 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:47:13 | MainThread:8607471104 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:47:13 | MainThread:8607471104 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:47:13 | MainThread:8607471104 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:47:13 | MainThread:8607471104 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:47:13 | MainThread:8607471104 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:47:13 | MainThread:8607471104 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:47:13 | MainThread:8607471104 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:47:13 | MainThread:8607471104 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:51:34 | MainThread:8630728192 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-08-18 17:51:34 | MainThread:8630728192 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-08-18 17:51:35 | MainThread:8630728192 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:51:35 | MainThread:8630728192 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:51:35 | MainThread:8630728192 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:51:35 | MainThread:8630728192 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:51:35 | MainThread:8630728192 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:51:35 | MainThread:8630728192 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:51:35 | MainThread:8630728192 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:51:35 | MainThread:8630728192 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:51:35 | MainThread:8630728192 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:51:35 | MainThread:8630728192 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:51:35 | MainThread:8630728192 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:51:35 | MainThread:8630728192 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:51:35 | MainThread:8630728192 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:51:35 | MainThread:8630728192 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:51:35 | MainThread:8630728192 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:51:35 | MainThread:8630728192 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:52:10 | MainThread:8659224064 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-08-18 17:52:10 | MainThread:8659224064 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-08-18 17:52:11 | MainThread:8659224064 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:52:11 | MainThread:8659224064 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:52:11 | MainThread:8659224064 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:52:11 | MainThread:8659224064 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:52:11 | MainThread:8659224064 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:52:11 | MainThread:8659224064 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:52:11 | MainThread:8659224064 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:52:11 | MainThread:8659224064 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:52:11 | MainThread:8673715712 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-08-18 17:52:11 | MainThread:8673715712 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-08-18 17:52:11 | MainThread:8673715712 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:52:11 | MainThread:8673715712 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:52:11 | MainThread:8673715712 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:52:11 | MainThread:8673715712 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:52:11 | MainThread:8673715712 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:52:11 | MainThread:8673715712 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:52:11 | MainThread:8673715712 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:52:11 | MainThread:8673715712 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:52:11 | MainThread:8673715712 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:52:11 | MainThread:8673715712 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:52:11 | MainThread:8673715712 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:52:11 | MainThread:8673715712 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:52:11 | MainThread:8673715712 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:52:11 | MainThread:8673715712 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:52:11 | MainThread:8673715712 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:52:11 | MainThread:8673715712 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:54:03 | MainThread:8596272640 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-08-18 17:54:03 | MainThread:8596272640 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-08-18 17:54:04 | MainThread:8596272640 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:54:04 | MainThread:8596272640 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:54:04 | MainThread:8596272640 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:54:04 | MainThread:8596272640 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:54:04 | MainThread:8596272640 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:54:04 | MainThread:8596272640 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:54:04 | MainThread:8596272640 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:54:04 | MainThread:8596272640 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:54:04 | MainThread:8596272640 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:54:04 | MainThread:8596272640 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:54:04 | MainThread:8596272640 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:54:04 | MainThread:8596272640 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:54:04 | MainThread:8596272640 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:54:04 | MainThread:8596272640 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:54:04 | MainThread:8596272640 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:54:04 | MainThread:8596272640 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:54:18 | MainThread:8627275264 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-08-18 17:54:18 | MainThread:8627275264 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-08-18 17:54:19 | MainThread:8627275264 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:54:19 | MainThread:8627275264 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:54:19 | MainThread:8627275264 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:54:19 | MainThread:8627275264 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:54:19 | MainThread:8627275264 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:54:19 | MainThread:8627275264 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:54:19 | MainThread:8627275264 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:54:19 | MainThread:8627275264 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:54:19 | MainThread:8627275264 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:54:19 | MainThread:8627275264 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:54:19 | MainThread:8627275264 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:54:19 | MainThread:8627275264 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:54:19 | MainThread:8627275264 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:54:19 | MainThread:8627275264 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:54:19 | MainThread:8627275264 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:54:19 | MainThread:8627275264 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:54:53 | MainThread:8669885952 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-08-18 17:54:53 | MainThread:8669885952 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-08-18 17:54:53 | MainThread:8669885952 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:54:53 | MainThread:8669885952 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:54:53 | MainThread:8669885952 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:54:53 | MainThread:8669885952 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:54:53 | MainThread:8669885952 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:54:53 | MainThread:8669885952 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:54:53 | MainThread:8669885952 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:54:53 | MainThread:8669885952 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:54:53 | MainThread:8669885952 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:54:53 | MainThread:8669885952 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:54:53 | MainThread:8669885952 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:54:53 | MainThread:8669885952 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:54:53 | MainThread:8669885952 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:54:53 | MainThread:8669885952 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:54:53 | MainThread:8669885952 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:54:53 | MainThread:8669885952 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:55:44 | MainThread:8626263552 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-08-18 17:55:44 | MainThread:8626263552 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-08-18 17:55:45 | MainThread:8626263552 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:55:45 | MainThread:8626263552 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:55:45 | MainThread:8626263552 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:55:45 | MainThread:8626263552 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:55:45 | MainThread:8626263552 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:55:45 | MainThread:8626263552 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:55:45 | MainThread:8626263552 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:55:45 | MainThread:8626263552 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:55:45 | MainThread:8626263552 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:55:45 | MainThread:8626263552 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:55:45 | MainThread:8626263552 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:55:45 | MainThread:8626263552 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:55:45 | MainThread:8626263552 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:55:45 | MainThread:8626263552 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:55:45 | MainThread:8626263552 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:55:45 | MainThread:8626263552 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:57:24 | MainThread:8671188480 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-08-18 17:57:24 | MainThread:8671188480 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-08-18 17:57:24 | MainThread:8671188480 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:57:24 | MainThread:8671188480 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:57:24 | MainThread:8671188480 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:57:24 | MainThread:8671188480 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:57:24 | MainThread:8671188480 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:57:24 | MainThread:8671188480 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:57:24 | MainThread:8671188480 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:57:24 | MainThread:8671188480 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:57:24 | MainThread:8671188480 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:57:24 | MainThread:8671188480 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:57:24 | MainThread:8671188480 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:57:24 | MainThread:8671188480 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:57:24 | MainThread:8671188480 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:57:24 | MainThread:8671188480 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:57:24 | MainThread:8671188480 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:57:24 | MainThread:8671188480 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:59:56 | MainThread:8629396992 | <module>:__init__:16 - INFO - start the automation service development environment
|
||||
2022-08-18 17:59:56 | MainThread:8629396992 | <module>:__init__:22 - INFO - loading environment configuration file
|
||||
2022-08-18 17:59:57 | MainThread:8629396992 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:59:57 | MainThread:8629396992 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:59:57 | MainThread:8629396992 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:59:57 | MainThread:8629396992 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:59:57 | MainThread:8629396992 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:59:57 | MainThread:8629396992 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:59:57 | MainThread:8629396992 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:59:57 | MainThread:8629396992 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
2022-08-18 17:59:57 | MainThread:8629396992 | create_app:app:28 - INFO - loading application configuration
|
||||
2022-08-18 17:59:57 | MainThread:8629396992 | create_app:app:29 - INFO - create FastApi app object
|
||||
2022-08-18 17:59:57 | MainThread:8629396992 | loading_router_middleware:app:16 - INFO - Adding a New route success
|
||||
2022-08-18 17:59:57 | MainThread:8629396992 | loading_router_middleware:app:24 - INFO - loading middleware success
|
||||
2022-08-18 17:59:57 | MainThread:8629396992 | create_app:app:38 - INFO - Application started successfully:CORSMiddleware
|
||||
2022-08-18 17:59:57 | MainThread:8629396992 | create_app:app:39 - INFO - Server address http://192.168.10.80:8000
|
||||
2022-08-18 17:59:57 | MainThread:8629396992 | create_app:app:40 - INFO - Api doc address http://192.168.10.80:8000/docs
|
||||
2022-08-18 17:59:57 | MainThread:8629396992 | create_app:app:41 - INFO - Api redoc address http://192.168.10.80:8000/redoc
|
||||
|
|
|
|||
160
utils/mem.py
160
utils/mem.py
|
|
@ -3,129 +3,77 @@
|
|||
# @Email :508737091@qq.com
|
||||
# @Author :qiangyanwen
|
||||
# @File :mem.py.py
|
||||
import os
|
||||
import psutil
|
||||
import datetime
|
||||
import time
|
||||
from entity.memory_entity import SysModel
|
||||
|
||||
|
||||
def get_sys_info():
|
||||
"""
|
||||
获取系统信息
|
||||
"""
|
||||
# 当前时间
|
||||
now_time = time.strftime('%Y-%m-%d-%H:%M:%S', time.localtime(time.time()))
|
||||
# print("当前时间:", now_time)
|
||||
# 获取系统启动时间
|
||||
system_start_info = "系统启动时间: %s" % datetime.datetime.fromtimestamp(psutil.boot_time()).strftime("%Y-%m-%d %H:%M:%S")
|
||||
# 获取系统用户
|
||||
now_time = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
|
||||
system_start_info = datetime.datetime.fromtimestamp(psutil.boot_time()).strftime("%Y-%m-%d %H:%M:%S")
|
||||
users_count = len(psutil.users())
|
||||
users_list = ",".join([u.name for u in psutil.users()])
|
||||
users_info = "当前有%s个用户,分别是 %s" % (users_count, users_list)
|
||||
sys_info = {"now_time": now_time, "system_start_time": system_start_info, "users_info": users_info}
|
||||
return sys_info
|
||||
users_name = ",".join([u.name for u in psutil.users()])
|
||||
sys = SysModel(count=users_count, name=users_name, current_time=now_time, start_time=system_start_info)
|
||||
return sys
|
||||
|
||||
|
||||
def get_cpu_info():
|
||||
"""
|
||||
获取cpu信息
|
||||
"""
|
||||
# 查看cpu物理个数的信息
|
||||
# print(u"物理CPU个数: %s" % psutil.cpu_count(logical=False))
|
||||
cpu_count = psutil.cpu_count(logical=False)
|
||||
# cpu的使用率
|
||||
cpu = (str(psutil.cpu_percent(1))) + '%'
|
||||
cp = "cup使用率: %s" % cpu
|
||||
cpu_info={"cpu_count":cpu_count,"cpu_usage":cpu}
|
||||
return cpu_info
|
||||
|
||||
|
||||
def bytes2human(n):
|
||||
"""
|
||||
内存单位转换
|
||||
:param n:
|
||||
:return:
|
||||
"""
|
||||
symbols = ('K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y')
|
||||
prefix = {}
|
||||
for i, s in enumerate(symbols):
|
||||
prefix[s] = 1 << (i + 1) * 10
|
||||
for s in reversed(symbols):
|
||||
if n >= prefix[s]:
|
||||
value = float(n) / prefix[s]
|
||||
return '%.1f%s' % (value, s)
|
||||
return '%sB' % n
|
||||
cpu = psutil.cpu_times()
|
||||
cpu = dict(cpu_count=psutil.cpu_count(logical=False), log_cpu=psutil.cpu_count(), user=cpu.user, system=cpu.system, nice=cpu.nice)
|
||||
return cpu
|
||||
|
||||
|
||||
def ge_mem_info():
|
||||
"""
|
||||
获取内存信息
|
||||
"""
|
||||
virtual_memory = psutil.virtual_memory()
|
||||
virtual_memory_count = bytes2human(virtual_memory.total)
|
||||
used_memory = bytes2human(virtual_memory.used)
|
||||
free_memory = bytes2human(virtual_memory.free)
|
||||
aval_memory = bytes2human(virtual_memory.available)
|
||||
memory_percent = virtual_memory.percent
|
||||
# memory_info = "总共内存:%s, 可用内存:%s, 内存使用:%s,使用率%0.1f%%,剩余内存:%s" % (
|
||||
# virtual_memory_count, aval_memory, used_memory, memory_percent, free_memory)
|
||||
mem_info={
|
||||
"total_memory": virtual_memory_count,
|
||||
"aval_memory":aval_memory,
|
||||
"memory_usage":used_memory,
|
||||
"memory_percent":memory_percent,
|
||||
"free_memory":free_memory
|
||||
|
||||
}
|
||||
info = psutil.virtual_memory()
|
||||
total = float(round(info.total) / 1024 / 1024 / 1024)
|
||||
available = float(round(info.available / 1024 / 1024 / 1024))
|
||||
percent = float(round(info.percent))
|
||||
used = float(round(info.used / 1024 / 1024 / 1024))
|
||||
free = float(round(info.free / 1024 / 1024 / 1024))
|
||||
mem_info = {
|
||||
"total": total,
|
||||
"available": available,
|
||||
"percent": percent,
|
||||
"used": used,
|
||||
"free": free}
|
||||
return mem_info
|
||||
|
||||
|
||||
def get_disk_info():
|
||||
"""
|
||||
获取磁盘信息
|
||||
"""
|
||||
F_BSIZE = 0
|
||||
F_BLOCKS = 2
|
||||
F_BAVAIL = 4
|
||||
# 循环磁盘分区
|
||||
disks = []
|
||||
for disk in psutil.disk_partitions():
|
||||
# 读写方式 光盘 or 有效磁盘类型
|
||||
if 'cdrom' in disk.opts or disk.fstype == '':
|
||||
continue
|
||||
disk_name_arr = disk.device.split(':')
|
||||
disk_name = disk_name_arr[0]
|
||||
disk_mount = disk.mountpoint
|
||||
vfs = os.statvfs(disk_mount)
|
||||
total_disk = vfs[F_BLOCKS] * vfs[F_BSIZE]
|
||||
free_disk = vfs[F_BAVAIL] * vfs[F_BSIZE]
|
||||
used_disk = total_disk - free_disk
|
||||
used_per = round((float(used_disk) / total_disk) * 100, 4)
|
||||
# 当前磁盘使用率和剩余空间G信息
|
||||
# disk_info = "%s盘使用率:%s%%, 剩余空间:%iGB" % (disk_name, str(used_per), free_disk//1024//1024//1024)
|
||||
disk_info ={"path":disk_name,"usage":str(used_per),"space":free_disk//1024//1024//1024//1024}
|
||||
disks.append(disk_info)
|
||||
return disks
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def get_net_info():
|
||||
"""
|
||||
获取网络信息
|
||||
"""
|
||||
net = psutil.net_io_counters()
|
||||
bytes_sent = '{0:.2f} Mb'.format(net.bytes_recv / 1024 / 1024)
|
||||
bytes_rcvd = '{0:.2f} Mb'.format(net.bytes_sent / 1024 / 1024)
|
||||
print("网卡接收数据 %s 网卡发送数据 %s" % (bytes_rcvd, bytes_sent))
|
||||
disk_info = psutil.disk_partitions()
|
||||
disk_list = []
|
||||
for disk in disk_info:
|
||||
content = psutil.disk_usage(disk.mountpoint)
|
||||
device = disk.device
|
||||
total = float(round(content.total) / 1024 / 1024 / 1024)
|
||||
used = float(round(content.used) / 1024 / 1024 / 1024)
|
||||
percent = float(round(content.percent) / 1024 / 1024 / 1024)
|
||||
free = float(round(content.free) / 1024 / 1024 / 1024)
|
||||
fs_type = disk.fstype
|
||||
opts = disk.opts
|
||||
info_dict = {
|
||||
"device": device,
|
||||
"total": "%.2f" % total,
|
||||
"used": "%.2f" % used,
|
||||
"percent": "%.2f" % percent,
|
||||
"fstype": fs_type,
|
||||
"opts": opts,
|
||||
"free": "%.2f" % free
|
||||
}
|
||||
disk_list.append(info_dict)
|
||||
return disk_list
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
now_time,users_info,system_start_info = get_sys_info()
|
||||
print(now_time,users_info,system_start_info)
|
||||
get_cpu_info()
|
||||
ge_mem_info()
|
||||
disk = get_disk_info()
|
||||
print(disk)
|
||||
get_net_info()
|
||||
# now_time,users_info,system_start_info = get_sys_info()
|
||||
# print(now_time,users_info,system_start_info)
|
||||
cpu = get_cpu_info()
|
||||
print(cpu)
|
||||
print(get_sys_info().dict())
|
||||
# info = ge_mem_info()
|
||||
# print(info)
|
||||
# print(get_disk_info())
|
||||
# disk = get_disk_info()
|
||||
# print(disk)
|
||||
# get_net_info()
|
||||
|
|
|
|||
Loading…
Reference in New Issue