Closed hcavarsan closed 2 months ago
The recent changes in the kftray-tauri
crate encompass refactoring functions for improved readability and maintainability, updating data structures for better performance, and enhancing logging capabilities. Key modifications include the introduction of a default_editor
function, the replacement of RwLock
with DashMap
for concurrency, and the addition of new async functions for handling port forwarding.
Files | Change Summary |
---|---|
crates/kftray-tauri/src/commands.rs |
Refactored open_log_file function by introducing default_editor and reorganizing try_open_with_editor and fallback_methods functions. |
crates/kftray-tauri/src/kubeforward/logging.rs |
Added DashMap dependency, updated TraceMap to use DashMap , introduced TraceInfo struct, replaced RwLock with BufWriter for log_file , and refactored logging methods. |
crates/kftray-tauri/src/kubeforward/port_forward.rs |
Increased BUFFER_SIZE , set TCP_NODELAY for client connections, and added async functionality to is_complete_request and is_complete_response functions. |
sequenceDiagram
participant User
participant Command
participant Logger
participant PortForward
User->>Command: Open log file
Command->>Command: default_editor()
Command->>Command: try_open_with_editor()
Command->>Command: fallback_methods()
Command-->>User: Log file opened
User->>Logger: Log request
Logger->>Logger: Insert trace info (DashMap)
Logger-->>User: Request logged
User->>PortForward: Forward port
PortForward->>PortForward: is_complete_request() (async)
PortForward->>PortForward: is_complete_response() (async)
PortForward-->>User: Port forwarded
This diagram illustrates the interactions between the user and the system components after the recent changes, highlighting the refactored methods and updated data handling.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
feat: improve http logging and tcp connections