-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/insights-features #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
Dillonu
commented
Jan 13, 2025
- Exported the startServer function in server.ts for better accessibility.
- Introduced SystemManager in MessageBroker for improved system management and resource disposal during shutdown.
- Enhanced error logging in ConnectionManager and WebSocket handling to include serviceId for better traceability.
- Updated logging in ServiceRegistry to provide more context in system message handling and added new methods for service subscriptions and topic subscribers.
- Improved logging in SubscriptionManager to include serviceId and topic details.
- Refactored metric management by removing unused imports and enhancing the UptimeSlot class with a lastModified getter.
- Updated message validation to use isUUID4 for request ID format checking in message.ts.
- Exported the startServer function in server.ts for better accessibility. - Introduced SystemManager in MessageBroker for improved system management and resource disposal during shutdown. - Enhanced error logging in ConnectionManager and WebSocket handling to include serviceId for better traceability. - Updated logging in ServiceRegistry to provide more context in system message handling and added new methods for service subscriptions and topic subscribers. - Improved logging in SubscriptionManager to include serviceId and topic details. - Refactored metric management by removing unused imports and enhancing the UptimeSlot class with a lastModified getter. - Updated message validation to use isUUID4 for request ID format checking in message.ts.
… buffer handling - Added new scripts to package.json for benchmarking heartbeat and metrics. - Updated MessageRouter to track message counts, rates, and sizes, including error handling metrics. - Modified ConnectionManager to handle messages as Buffers instead of strings, improving performance and type safety. - Enhanced WebSocketConnection to pass Buffer messages to listeners. - Updated types to include message size for better monitoring. - Introduced new metrics for monitoring message handling and system performance.
…ering capabilities - Updated serializeMetrics method in MonitoringManager to accept a paramFilter for conditional metric serialization. - Introduced filteredMetrics method in ParameterizedMetric to filter metrics based on provided parameters. - Refactored ServiceRegistry to utilize the new parameter filtering in metrics serialization. - Added getSubscribedInfo method in SubscriptionManager to improve clarity in fetching subscribed topics.
- Updated the MessageUtils.Parser to accept a Buffer instead of a string for improved performance and type safety. - Modified the ConnectionManager to create the parser using a Buffer directly, enhancing message handling capabilities. - Adjusted parsing methods to convert Buffer data to strings where necessary, ensuring compatibility with existing functionality.
…package-lock.json, and README.md for improved clarity and consistency. Update repository URLs and documentation references accordingly.
…ture and improve compatibility.
…ging - Improved priority handling by checking for existing subscriptions and updating priorities as necessary. - Added detailed logging for subscription actions, including cases of existing subscriptions and priority updates, to enhance traceability.
…gistry - Added checks to ensure the service name does not exceed 36 characters and the description does not exceed 1024 characters. - Introduced error handling for invalid input to enhance robustness and prevent potential issues during service registration.
- Added SSL key and certificate configuration options to the application, allowing secure WebSocket connections. - Updated the configuration interface to include optional SSL properties. - Modified the WebSocket server creation logic to utilize SSL if provided, improving security for WebSocket communications.
- Updated the WebSocket server initialization to listen on the configured port directly when SSL is enabled, improving clarity and reducing complexity in the server setup. - Maintained existing functionality for non-SSL connections, ensuring consistent behavior across different configurations.
- Updated MessageError class to include an optional timestamp parameter for better error tracking. - Refactored various error classes (InvalidRequestError, MalformedMessageError, etc.) to inherit from the updated MessageError, ensuring consistent error handling. - Improved ConnectionManager and ServiceRegistry to utilize the new message parsing capabilities, enhancing error handling and message routing. - Modified MessageUtils.Parser to handle Buffer input and validate message formats more robustly, including improved error reporting. - Updated types in utils to better reflect the structure of headers and payloads, ensuring type safety across message handling. - Enhanced monitoring capabilities by integrating metrics tracking for message sizes and error occurrences.
- Added a new benchmark script for UUID generation in package.json. - Updated ConnectionManager to include SubscriptionManager for improved message routing and subscriber notifications. - Refactored ServiceRegistry to ensure consistent response headers with request IDs for better tracking. - Enhanced MessageRouter to handle message publishing and error responses more effectively. - Improved MessageUtils to generate broker headers with optional request IDs, ensuring better message integrity and traceability. - Updated types to streamline header management and improve type safety across message handling.
- Introduced BrokerMessageAudit and ClientMessageAudit interfaces for improved message tracking. - Updated ConnectionManager to include maskedId in sendMessage method for better message integrity. - Refactored ServiceRegistry and MessageRouter to ensure consistent usage of requestId across message handling. - Improved MessageUtils to serialize payloads and headers more effectively, enhancing type safety. - Updated types to reflect changes in requestId naming convention, ensuring consistency across the codebase.
…erialization - Updated the payload structure in ConnectionManager to use an object instead of a string, enhancing type safety and consistency.
- Added a new script in package.json for starting a WebSocket client with echo functionality. - Refactored ConnectionManager to streamline error handling by consolidating message sending logic. - Updated MessageRouter to improve request ID management and enhance logging for timeout and error scenarios. - Improved message parsing validation in the Parser class to ensure proper request ID format. These changes aim to improve the robustness and traceability of message handling across the application.
- Updated ConnectionManager to improve message serialization and handling of parentRequestId. - Enhanced MessageRouter to manage request IDs more effectively and provide detailed timeout error responses. - Modified MessageUtils to streamline broker header creation by removing unnecessary parentRequestId logic. These changes aim to enhance the robustness and clarity of message processing across the application.
- Modified WebSocket connection initialization in the websocket-client-echo.ts file to use the WS_PROTOCOL environment variable, allowing for flexible protocol selection (ws or wss). - This change enhances the configurability of WebSocket connections, improving the application's adaptability to different environments.
…est.noroute' in websocket-client-echo.ts
- Added process.exit(1) on connection errors to ensure the application terminates when unable to connect to the Message Broker. - Implemented process.exit(0) on WebSocket closure to gracefully exit the application when a connection is closed. These changes enhance the robustness of the WebSocket client by ensuring proper termination in error scenarios.
…handling improvements - Added support for subscribing to the 'test.end' topic when ENABLE_LISTENER is enabled, allowing for better message tracking. - Implemented a message listener to log received messages, improving visibility into the WebSocket communication. - Refactored message sending logic for 'test.noroute' to use the REQUEST type and updated 'test.end' to use the PUBLISH type, ensuring correct message semantics. These changes aim to improve the robustness and traceability of message handling in the WebSocket client.
- Added support for subscribing to the 'test.end' topic when ENABLE_LISTENER is enabled, improving message tracking and responsiveness. - This change enhances the overall functionality of the WebSocket client by allowing it to listen for specific events, thereby increasing its robustness in message handling.
…ion handling - Updated comments and conditions in the SubscriptionManager to correctly reflect the intended logic for subscriber priority comparison. - Ensured that the iteration checks for existing subscriptions are accurate, enhancing the reliability of subscription management.
…ption handling - Updated the index initialization and iteration logic to correctly handle subscriber priority comparisons. - Enhanced comments for clarity, ensuring the intended logic is accurately reflected in the code. - These changes improve the reliability of subscription management by ensuring proper checks for existing subscriptions.
- Updated config loading to remove optional SSL configuration - Simplified environment variable parsing for SSL configuration - Enhanced test coverage for config loading with SSL environment variables - Improved type definition for SSL configuration in types.ts
- Added logic to stop existing interval before starting a new one in SystemManager - Enhanced test coverage for SystemManager with comprehensive test scenarios - Improved interval management and metrics collection reliability - Updated test mocks to prevent auto-start and provide more precise timer assertions
- Simplified message routing error handling in handleMessage method - Improved test coverage for ConnectionManager with comprehensive message handling scenarios - Added tests for various message routing error cases, payload forwarding, and connection management - Streamlined code by removing redundant error handling conditions - Enhanced subscriber message forwarding logic
- Improved test suite documentation for MonitoringManager, SubscriptionManager, and SystemManager - Added comprehensive comments explaining test scenarios and edge cases - Removed redundant test cases in SubscriptionManager - Enhanced readability and maintainability of test files - Standardized mock setup for logger across test suites
- Removed request count limit check in routeMessage method - Simplified request generation and subscriber selection logic - Enhanced error handling and metrics tracking for different message actions - Added comprehensive test coverage for various routing scenarios - Improved timeout and request eviction handling
- Implemented a new test case for MonitoringManager to verify full metric information retrieval - Ensured that serialized metrics include detailed metadata like name, type, value, and timestamp - Verified filtering of metrics based on specific parameters (interface in this case) - Improved test coverage for metric serialization with comprehensive information
…erage - Added extensive test cases for Parser class, covering error object validation, message component access, and header parsing - Implemented new tests for serializePayload function with different payload types - Expanded serialize function tests to handle various header combinations and optional fields - Added toBrokerHeader function tests to verify header conversion and request ID generation - Improved error handling and validation for message parsing and serialization
…larity - Enhanced test suite documentation with more precise and concise comments - Simplified test case descriptions to focus on core functionality - Improved readability of test scenarios for message parsing, serialization, and validation - Standardized JSDoc comments across test groups - Maintained comprehensive test coverage while reducing verbosity
- Implemented a new test case to verify MessageError creation with a custom timestamp - Ensured that the provided timestamp is correctly set when creating a MessageError - Expanded error class test coverage to include timestamp customization
- Update SSL configuration handling in config loading - Modify WebSocket server creation to handle optional SSL configuration - Improve UUID4 validation function by removing null/undefined checks - Add comprehensive tests for SSL-enabled WebSocket server creation
- Deleted `src/core/monitoring/metrics/system.ts` which contained outdated system metrics implementation - Removed corresponding test file `test/unit/core/monitoring/metrics/system.spec.ts` - Cleaned up unused imports in WebSocket connection test file - Added more descriptive comments to existing metric slot test files
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.