Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor sidecar/interface.rs into smaller files (#395)
Refactor the sidecar::interface file into multiple files in a sidecar::service namespace. * remove unnecessary clippy allow for needless collect in sidecar interface MSRV is greater than 1.60, so we can remove this allow. * refactor Sidecar::Interface::InstanceId to separate file Also, add basic test and doc comments * refactor Sidecar::Interface::QueueId to a separate file. And add tests and doc comments * refactor sidecar::interface::RuntimeMeta to separate file And rename to RuntimeMetadata, add basic doc comments and tests. * minor cleanup of sidecar::interface file. * Fix typo for intitial_acitons input paramater to get_app * Reorder impl to match trait order * remove redundant prefixes * refactor Sidecar::Interface::SerializedTracerHeaderTags to a separate file Also, The From SerializedTracerHeaderTags and From TracerHeaderTags trait impls were changed to try_into trait impls as it is possible (however unlikely) that the code within the the trait impls could return errors and it is preferable to let the caller decide how to handle those errors rather than unwrap a Result and potentially panic. * refactor RequestIdentifier and RequqestIdentification to separate file and add doc comments * refactor sidecar_interface from interface.rs to separate file * Refactor sidecar::interface::SessionInfo to its own file. Also, add rustdoc comments and tests. Uncovered a bug in the shtudown_running_instances function where it never shutdown the running instances. * refactor Sidecar::SidecarServer to separate file * extract session interceptor into separate function in sidecar_server * sidecar server - move logic for processing of interceptor response Refactor into separate function. Also, replace unwraps() with expects(). * Add rustdoc comments for public sidecar_server methods * Minor tweak to sidecar session_info::shutdown_runtime to reduce mutex lock scope * refactor sidecar RuntimeInfo from interface.rs to separate file * refactor complex type in sidecar RuntimeInfo * Sidecar - move SessionConfig, SidecarAction, and ApporQueue structs Moving from interface.rs to separate files * refactor sidecar::AppInstance in to separate file * sidecar - refactor enqueued_telemetry_data and enqueued_telemetry_stats to separate files * sidecar - refactor tracing logic in interface.rs to separate files * refactor SidecarStats to telemetry namespace * Move blocking sidecar_interface to separate file * Reduce visibility scope of types after sidecar::interface refactor interface.rs has been refactored in to a "service" module within sidecar. During refactor the access level of some functions and types was increased while they were being moved around. This should "fix" the access level to the most restrictive possible. * Move SidecarStats and AppOrQueue structs to more appropriate locations. After refactor of sidecar::interface.rs into multiple files AppOrQueue belongs in the telemetry namespace and SidecarStats belongs closer to the code it is generating stats for in SidecarServer.
- Loading branch information