Merge branch 'enhance-doc' into 'master'

Enhance and update doc

See merge request micro-ROS/ros_tracing/ros2_tracing!125
This commit is contained in:
Christophe Bedard 2020-01-01 00:07:37 +00:00
commit d7875ccd74

View file

@ -647,9 +647,19 @@ tracetools_analysis <-- ros2trace_analysis
@enduml @enduml
``` ```
## Analysis architecture ## Analysis
With profiling as an example implementation. ### Design
Generally, for a given trace data analysis objective, the following classes are extended: `EventHandler`, `DataModel`, and `DataModelUtil`.
A user/developer can implement an `EventHandler`, which defines callbacks for specific events. Those callbacks get called by the `Processor`, and end up putting slightly-processed data into a `DataModel`, which is a data container that uses `pandas` `DataFrame`s.
Meaningful data can be extracted from the `DataModel`. However, a `DataModelUtil` can provide common utility functions so that users don't have to re-write them. This meaningful output data can then be presented through a Jupyter notebook (e.g. plots) or a normal Python script (e.g. tables).
### Architecture
With profiling as an example implementation:
```plantuml ```plantuml
@startuml @startuml
@ -669,7 +679,7 @@ abstract class Dependant {
+dependencies(): list {static} +dependencies(): list {static}
} }
abstract class EventHandler { abstract class EventHandler {
+handler_map +handler_map(): map
+data(): DataModel {abstract} +data(): DataModel {abstract}
+process(events) {static} +process(events) {static}
} }
@ -684,6 +694,7 @@ EventHandler <|-- ProfileHandler
Processor o-- EventHandler Processor o-- EventHandler
abstract class DataModel { abstract class DataModel {
+print_data() {abstract}
} }
class ProfileDataModel { class ProfileDataModel {
+times: DataFrame +times: DataFrame
@ -693,6 +704,7 @@ DataModel <|-- ProfileDataModel
ProfileDataModel o-- ProfileHandler ProfileDataModel o-- ProfileHandler
abstract class DataModelUtil { abstract class DataModelUtil {
+print_data(): DataModel
+convert_time_columns(df, columns): df {static} +convert_time_columns(df, columns): df {static}
} }
class ProfileDataModelUtil { class ProfileDataModelUtil {