Commit graph

11 commits

Author SHA1 Message Date
KOMATA
38985671c6
perf: improve getNetConnections function and Websocket handling (#11269)
* feat: Enhance WebSocket client functionality and improve data processing

- Reduced message queue size in WebSocket client from 100 to 32.
- Introduced atomic boolean to track client closure state.
- Added SendPayload method to handle message sending with queue management.
- Updated ProcessData function to utilize SendPayload for sending responses.
- Expanded netTypes to include both IPv4 and IPv6 protocols in network connection retrieval.
- Improved net connection processing by using a map for process names, enhancing efficiency.

* feat: Enhance WebSocket client and process data handling

- Added synchronization with sync.Once for safe closure of WebSocket client.
- Updated message queue size to a constant for better maintainability.
- Implemented context timeouts for process data retrieval to prevent blocking.
- Improved network connection handling by utilizing a more efficient method for retrieving connections.
- Introduced a new function to determine connection types based on protocol family.

* feat: Enhance network connection retrieval and process name mapping

- Updated getNetConnections function to improve efficiency by using maps for process names and connections.
- Introduced a new helper function to retrieve process names from the filesystem or process context.
- Enhanced filtering logic for network connections based on process ID, name, and port.
- Increased initial capacity for connection results to optimize performance.

* refactor: Rename SendPayload method to Send in WebSocket client

- Updated the SendPayload method to be more succinctly named Send for clarity.
- Ensured the method continues to handle message sending while maintaining existing functionality.

* refactor: Update ProcessData and getNetConnections for improved clarity and efficiency

- Replaced SendPayload method calls with Send for consistency in WebSocket message handling.
- Enhanced getNetConnections function by refining process name retrieval and filtering logic.
- Improved error handling in getProcessNameWithContext for better robustness.

* refactor: Simplify WebSocket client closure and reading logic

- Removed unnecessary synchronization for closing the WebSocket client.
- Updated the Read method to handle message reading directly without a separate Close method.
- Ensured the Socket is closed properly after reading messages to prevent resource leaks.
2025-12-09 17:30:12 +08:00
KOMATA
3a1b9fedd1
perf: Simplify process data handling and improve performance (#11236)
* refactor: Simplify process data handling and improve performance

- Replaced goroutine-based processing with a direct loop for handling process data.
- Introduced context support for process and connection retrieval.
- Enhanced error handling and data structuring for process information.
- Improved SSH session retrieval by mapping users by host for better efficiency.

* chore: go fmt
2025-12-08 17:34:52 +08:00
KOMATA
bb72ea0fc0
fix: Improve SSH session retrieval by grouping users by host in process_data.go (#11210) 2025-12-08 16:39:08 +08:00
CityFun
dc9fdf897b
feat: add more fields to process detail view (#11093) 2025-11-27 11:21:44 +08:00
CityFun
f1677f5a67
fix: resolve network connection count always showing 0 in process list (#10979) 2025-11-18 14:04:23 +08:00
CityFun
8bdf02c4c0
perf: Optimize process management performance (#10329) 2025-09-10 09:02:53 +00:00
CityFun
fb44e3c1e2
fix: Fix the issue where SSH sessions keep loading indefinitely (#9964)
Refs https://github.com/1Panel-dev/1Panel/issues/9943
2025-08-12 09:28:48 +00:00
zhengkunwang
b871c710b2
fix(file): fix issue with download process not work (#8237) 2025-03-25 09:27:34 +00:00
ssongliu
4f1a56e66c
feat: merge code from dev (#7750) 2025-01-21 10:32:14 +00:00
zhengkunwang
14c4d3c862
feat(file): Optimize file download progress tracking (#7186) 2024-11-26 14:04:31 +00:00
ssongliu
8d28b7db94 pref: backend 重命名 agent 2024-07-23 14:48:37 +08:00