-
Notifications
You must be signed in to change notification settings - Fork 54
Fixing some of the diagrams in the mw/log section #71
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
Closed
MaciejKaszynski
wants to merge
1
commit into
eclipse-score:main
from
etas-contrib:feature/logging-arch-diagrams
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
19 changes: 19 additions & 0 deletions
19
score/mw/log/design/circular_buffer_allocator_acquireslottowrite.puml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| @startuml circular_buffer_allocator_acquireslottowrite | ||
| title Circular Buffer Allocator Acquire Slot To Write | ||
| start | ||
| :Loop Counter = 0; | ||
| repeat :Increment loop counter; | ||
| :Atomically | ||
| Get slot | ||
| Increment next slot index; | ||
| :Slot index = claimed slot % circular buffer capacity; | ||
| if (Loop counter > circular buffer size) then (Yes) | ||
| :Return empty; | ||
| stop | ||
| else (No) | ||
| endif | ||
| repeat while (Slot in use?) is (Yes) not (No); | ||
| :Mark Slot as in use; | ||
| :Return Slot index; | ||
| stop | ||
| @enduml |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| @startuml configuration_sequence | ||
| title Configuration Sequence | ||
|
|
||
| participant "App" as App | ||
| participant "Logger" as LOG | ||
| participant "LogStreamFactory" as LSF | ||
| participant "Runtime" as RT | ||
| participant "RecorderFactory" as RF | ||
| participant "TargetConfigReader" as TCR | ||
| participant "ConfigurationFileDiscoverer" as CFD | ||
| participant "JSON" as JSON | ||
| participant "OS" as OS | ||
|
|
||
| activate App | ||
|
|
||
| App -> LOG **: CreateLogger(...) | ||
| note right of LOG | ||
| The initialization of the runtime is triggered by the first log call. | ||
| endnote | ||
|
|
||
| activate LOG | ||
|
|
||
| App -> LOG: LogError() | ||
|
|
||
| LOG -> LSF: GetStream(LogLevel) | ||
|
|
||
| LSF -> RT: GetRecorder() | ||
|
|
||
| alt Runtime instance has not been created | ||
| RT -> RT: Constructor | ||
| activate RT | ||
| end | ||
|
|
||
| RT -> RF **: CreateRecorderFactory() | ||
|
|
||
| activate RF | ||
|
|
||
| RT -> RF: CreateFromConfiguration() | ||
|
|
||
|
|
||
| RF -> CFD **: make_unique<ConfigurationFileDiscoverer>(...) | ||
| activate CFD | ||
|
|
||
| RF -> TCR **: make_unique<TargetConfigReader>(ConfigurationFileDiscoverer) | ||
| activate TCR | ||
|
|
||
|
|
||
| RF -> TCR: ReadConfig() | ||
|
|
||
| TCR -> CFD: FindConfigurationFiles() | ||
|
|
||
| note right of CFD | ||
| Find and return the existing | ||
| config files. | ||
| end note | ||
|
|
||
| CFD -> OS: access(/etc/ecu_logging_config.json) | ||
| alt MW_LOG_CONFIG_FILE is defined | ||
| CFD -> OS: access(MW_LOG_CONFIG_FILE) | ||
| else MW_LOG_CONFIG_FILE is undefined | ||
| CFD -> OS: access(<cwd>/etc/logging.json) | ||
| CFD -> OS: access(<cwd>/logging.json) | ||
| CFD -> OS: access(<binary path>/../etc/logging.json) | ||
| end | ||
|
|
||
| CFD -> TCR: Return global and environmental or application config file paths. | ||
|
|
||
| TCR -> JSON: FromFile(global_file_path) | ||
| JSON -> TCR: | ||
|
|
||
| alt MW_LOG_CONFIG_FILE is defined | ||
| TCR -> JSON: FromFile(<environmental file path>) | ||
| JSON -> TCR: | ||
| else MW_LOG_CONFIG_FILE is undefined | ||
| TCR -> JSON: FromFile(<app_file_path>) | ||
| JSON -> TCR: | ||
| end | ||
|
|
||
| note right of TCR | ||
| Overwrite global configiuration | ||
| with environmental or application config file paths. | ||
| end note | ||
|
|
||
| TCR -> RF: Return Configuration instance | ||
|
|
||
| alt "Console only recorder (compile option)" | ||
|
|
||
| Create "TextRecorder" as TR | ||
| RF -> TR: Create instance with configuration | ||
|
|
||
| RF -> ER: if logmode other than KConsole is provided. | ||
|
|
||
| else "Datarouter (compile option)" | ||
|
|
||
| Create "CompositeRecorder" as CR | ||
|
|
||
| RF -> CR | ||
| note left of CR | ||
| Recorder setup depends on the datarouter configuration. | ||
| endnote | ||
| end | ||
|
|
||
| RF -> RT: Store returned instance | ||
|
|
||
| RT -> LSF: Return Recorder reference | ||
| LSF -> LOG: LogStream with Recorder | ||
|
|
||
| @enduml | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| @startuml configuration_use_cases | ||
| left to right direction | ||
| title Configuration Use Cases | ||
|
|
||
| actor "Developer\nDebug application\ndeployed on target" as Dev1 | ||
|
|
||
| actor "Developer,\nUnit testing" as Dev2 | ||
| actor "Performance\nEngineer" as PerfEng | ||
|
|
||
| usecase "ECU wide configuration\n--\nECUID = MPP1\nLogLevel = kError" as UC1_ECU | ||
| usecase "Application configuration\n--\nAPPID = Para\nLogMode = kRemote | kConsole\nLogLevel = kDebug" as UC1_App | ||
|
|
||
| usecase "Print the logs on the console for\nanalysis of unit test failures." as UC2_Console | ||
| usecase "No logging.json files" as UC2_Default | ||
|
|
||
| usecase "Disable logging completely\nMeasure performance impact of logging" as UC3_Performance | ||
|
|
||
| Dev1 --> UC1_ECU : "Use case 1" | ||
| Dev1 --> UC1_App : "Use case 1" | ||
|
|
||
| Dev2 --> UC2_Console : "Use case 2" | ||
| Dev2 --> UC2_Default : "Use case 2" | ||
|
|
||
| PerfEng --> UC3_Performance : "Use case 3" | ||
|
|
||
| @enduml |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| @startuml frontend_dependency_graph | ||
| title Frontend Dependency Graph | ||
|
|
||
| package "mw::log frontend" as frontend { | ||
| class score::mw::log::Logger { | ||
| +Includes classes and free functions | ||
| } | ||
| class score::mw::log::detail::LogStreamFactory | ||
| class score::mw::log::LogStream | ||
| class score::mw::log::detail::Runtime | ||
| class score::mw::log::LoggerContainer | ||
| class score::mw::log::LogTypes | ||
| abstract score::mw::log::Recorder | ||
| abstract score::mw::log::IRecorderFactory | ||
| } | ||
|
|
||
| package "mw::log implementation details" as details { | ||
| class score::mw::log::detail::Configuration {} | ||
| class score::mw::log::detail::TargetConfigReader {} | ||
|
|
||
| class score::mw::log::detail::ConsoleRecorder {} | ||
| class score::mw::log::detail::ConsoleRecorderFactory {} | ||
| class score::mw::log::detail::EmptyRecorder {} | ||
|
|
||
| class score::mw::log::detail::RecorderFactory {} | ||
| } | ||
|
|
||
|
|
||
| note top of frontend | ||
| Frontend contains the public user API, | ||
| and the necessary classes to interface | ||
| with the recorder interface. | ||
| end note | ||
|
|
||
| note bottom of details | ||
| Instable components shall | ||
| depend on stable classes. | ||
| end note | ||
|
|
||
| score::mw::log::detail::LogStreamFactory ..> score::mw::log::LogStream | ||
| score::mw::log::detail::Runtime o-- score::mw::log::LoggerContainer | ||
| score::mw::log::detail::Runtime --> score::mw::log::Recorder | ||
| score::mw::log::detail::Runtime o-- score::mw::log::Recorder | ||
| score::mw::log::detail::Runtime --> score::mw::log::detail::Configuration | ||
| score::mw::log::detail::Configuration --> score::mw::log::detail::TargetConfigReader | ||
| score::mw::log::Recorder <|-- score::mw::log::detail::EmptyRecorder | ||
|
|
||
| score::mw::log::Recorder <|-- score::mw::log::detail::ConsoleRecorder | ||
| score::mw::log::IRecorderFactory <|-- score::mw::log::detail::ConsoleRecorderFactory | ||
| score::mw::log::detail::ConsoleRecorderFactory ..> score::mw::log::detail::ConsoleRecorder | ||
|
|
||
| score::mw::log::LogStream --> score::mw::log::Recorder | ||
| score::mw::log::Logger ..> score::mw::log::LogStream | ||
| score::mw::log::LoggerContainer o-- score::mw::log::Logger | ||
|
|
||
| @enduml |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CreateLogger only registers a logger in the container butdoes not trigger the runtime initialization. The initialization is triggered by the first log call. A note would make sense here.