Commit graph

4 commits

Author SHA1 Message Date
Max
251b0591a2 Refactor test files for improved readability and consistency
- Adjusted indentation and formatting in `trace_concurrent_test.go` and `trace_node_test.go` to enhance code clarity.
- Ensured consistent structure in test cases by aligning the setup and assertions, improving overall maintainability.
2025-11-18 19:17:27 +08:00
Max
47a35b7e63 Refactor trace manager for improved state management and concurrency
- Replaced the previous node and space management with a channel-based state management system in `manager.go`, enhancing concurrency handling.
- Implemented methods for loading and saving trace updates to disk in `local/driver.go` and `store/driver.go`, allowing for persistent state across sessions.
- Updated subscription handling in `subscription.go` to streamline the process of broadcasting updates to active subscribers.
- Enhanced node and trace status management, including cancellation and completion states, to provide better control over trace execution.
- Adjusted related tests to ensure compatibility with the new state management approach.
2025-11-18 18:08:20 +08:00
Max
a7210f027f Refactor trace package tests for improved readability
- Removed unnecessary blank lines in multiple test files to enhance code clarity and maintainability.
- Adjusted formatting in `subscription.go`, `trace_bench_test.go`, `trace_concurrent_test.go`, `trace_mem_test.go`, `trace_node_test.go`, `trace_space_test.go`, and `trace_subscription_test.go` for consistency.
2025-11-18 15:48:21 +08:00
Max
3a46d98663 Enhance trace package functionality and improve concurrency handling
- Updated benchmark and memory leak detection commands in the Makefile to include both agent and trace components.
- Refactored the manager struct in `manager.go` to support cancellable contexts and added per-space locks for improved concurrency safety.
- Enhanced subscription handling in `subscription.go` to only broadcast updates if there are active subscribers, preventing unnecessary operations.
- Implemented comprehensive disk operations in `local/driver.go` and `store/driver.go` for managing trace nodes, spaces, and logs, including loading, saving, and deleting functionalities.
- Improved README documentation to clarify driver configurations and usage examples for trace management.
2025-11-18 15:47:44 +08:00