1+ @startuml
2+ 'https://plantuml.com/class-diagram'
3+
4+ package "sdk" {
5+
6+ class PerformanceTestSpec {
7+ - String inspector
8+ - String appId
9+ - String deviceId
10+ - String name
11+ }
12+ interface PerformanceInspector {
13+ void initialize (PerformanceTestSpec performanceTestSpec )
14+ PerformanceInspectionResult inspect (PerformanceTestSpec performanceTestSpec )
15+ PerformanceTestResult parse (List <PerformanceInspectionResult >)
16+ }
17+
18+ interface IPerformanceInspectionService {
19+ void reset (PerformanceInspection );
20+ PerformanceInspectionResult inspect (PerformanceInspection );
21+ void inspectWithStrategy (PerformanceInspection , InspectionStrategy );
22+ List <PerformanceTestResult > parse ();
23+ }
24+
25+ class PerformanceInspectionService {
26+ }
27+
28+ class PerformanceTestResult {
29+ String category
30+ Object performanceData
31+ List<PerformanceInspectionResult> performanceInspectionResultList
32+ }
33+
34+ class PerformanceInspectionResult {
35+ String type;
36+ File profilingRawResultFile;
37+ }
38+
39+ PerformanceInspector -left ..> PerformanceTestSpec
40+ PerformanceInspector -up ..> PerformanceInspectionResult
41+ PerformanceInspector <--- right PerformanceInspectionService
42+ PerformanceInspector -up ..> PerformanceTestResult
43+ PerformanceTestResult -right ..> PerformanceInspectionResult
44+ PerformanceInspectionService - u -|> IPerformanceInspectionService
45+ }
46+
47+ package "agent" {
48+ abstract class TestRunner {
49+ }
50+ }
51+
52+ package "common" {
53+ class PerformanceTestManagementService {
54+
55+ }
56+
57+ PerformanceInspector <|-- AndroidBatteryInspector
58+ PerformanceInspector <|-- AndroidMemoryInfoInspector
59+ PerformanceInspector <|-- AndroidMemoryDumpInspector
60+ PerformanceInspector <|-- WindowsBatteryInspector
61+ PerformanceInspector <|-- WindowsMemoryInspector
62+
63+ AndroidBatteryInspector --o PerformanceTestManagementService
64+ AndroidMemoryInfoInspector --o PerformanceTestManagementService
65+ AndroidMemoryDumpInspector --o PerformanceTestManagementService
66+ WindowsBatteryInspector --o PerformanceTestManagementService
67+ WindowsMemoryInspector --o PerformanceTestManagementService
68+ PerformanceTestManagementService --|> IPerformanceInspectionService
69+
70+ TestRunner o- u - PerformanceTestManagementService
71+ }
72+ @enduml
73+
74+ @startuml
75+ participant PerformanceManager
76+ participant Runner
77+ participant PerformanceInspectionService
78+ participant AndroidMemoryInfoInspector
79+ participant AndroidBatteryInspector
80+ participant WindowsBatteryInspector
81+
82+ title Sequence 1: Regularly inspect performance metrics
83+
84+ PerformanceManager -> PerformanceManager : new Inspectors
85+ activate Runner
86+ Runner -> PerformanceInspectionService : new PerformanceInspectionService()
87+ activate PerformanceInspectionService
88+ Runner -> PerformanceManager : get Inspectors
89+ PerformanceManager -> Runner : Inspectors
90+ Runner -> PerformanceInspectionService : add Inspectors
91+ Runner -> PerformanceInspectionService : startInspectPerformanceTimer(performanceTestSpec, interval)
92+ PerformanceInspectionService -> AndroidMemoryInfoInspector : initialize
93+ PerformanceInspectionService -> AndroidBatteryInspector : initialize
94+ PerformanceInspectionService -> WindowsBatteryInspector : initialize
95+ PerformanceInspectionService -> AndroidMemoryInfoInspector : inspect
96+ AndroidMemoryInfoInspector -> PerformanceInspectionService : PerformanceInspectionResult
97+ PerformanceInspectionService -> AndroidBatteryInspector : inspect
98+ AndroidBatteryInspector -> PerformanceInspectionService : PerformanceInspectionResult
99+ PerformanceInspectionService -> WindowsBatteryInspector : inspect
100+ WindowsBatteryInspector -> PerformanceInspectionService : PerformanceInspectionResult
101+ Runner -> PerformanceInspectionService : parse
102+ PerformanceInspectionService -> AndroidMemoryInfoInspector : parse
103+ AndroidMemoryInfoInspector -> PerformanceInspectionService : PerformanceTestResult
104+ PerformanceInspectionService -> AndroidBatteryInspector : parse
105+ AndroidBatteryInspector -> PerformanceInspectionService : PerformanceTestResult
106+ PerformanceInspectionService -> WindowsBatteryInspector : parse
107+ WindowsBatteryInspector -> PerformanceInspectionService : PerformanceTestResult
108+ PerformanceInspectionService -> Runner : List<PerformanceTestResult>
109+ deactivate PerformanceInspectionService
110+ deactivate Runner
111+ @enduml
112+
113+ @startuml
114+ participant PerformanceManager
115+ participant Runner
116+ participant TestCase
117+ participant PerformanceInspectionService
118+ participant AndroidMemoryInfoInspector
119+ participant AndroidBatteryInspector
120+ participant WindowsBatteryInspector
121+ participant ThreadParam
122+
123+ title Sequence 2: Trigger performance metrics inspection by test case
124+
125+ PerformanceManager -> PerformanceManager : new Inspectors
126+ activate Runner
127+ Runner -> PerformanceInspectionService : new PerformanceInspectionService()
128+ activate PerformanceInspectionService
129+ Runner -> PerformanceManager : get Inspectors
130+ PerformanceManager -> Runner : Inspectors
131+ Runner -> PerformanceInspectionService : add Inspectors
132+ Runner -> ThreadParam : init(..., PerformanceInspectionService)
133+ activate ThreadParam
134+ Runner -> TestCase : execute
135+ activate TestCase
136+ TestCase -> ThreadParam : getPerformanceInspectionService
137+ ThreadParam -> TestCase : PerformanceInspectionService
138+ TestCase -> PerformanceInspectionService : initialize
139+ PerformanceInspectionService -> AndroidMemoryInfoInspector : initialize
140+ PerformanceInspectionService -> AndroidBatteryInspector : initialize
141+ PerformanceInspectionService -> WindowsBatteryInspector : initialize
142+ TestCase -> PerformanceInspectionService : inspect
143+ PerformanceInspectionService -> AndroidMemoryInfoInspector : inspect
144+ AndroidMemoryInfoInspector -> PerformanceInspectionService : PerformanceInspectionResult
145+ PerformanceInspectionService -> AndroidBatteryInspector : inspect
146+ AndroidBatteryInspector -> PerformanceInspectionService : PerformanceInspectionResult
147+ PerformanceInspectionService -> WindowsBatteryInspector : inspect
148+ WindowsBatteryInspector -> PerformanceInspectionService : PerformanceInspectionResult
149+ PerformanceInspectionService -> TestCase : List<PerformanceInspectionResult>
150+ TestCase -> Runner : return
151+ deactivate
152+ Runner -> PerformanceInspectionService : parse
153+ PerformanceInspectionService -> AndroidMemoryInfoInspector : parse
154+ AndroidMemoryInfoInspector -> PerformanceInspectionService : PerformanceTestResult
155+ PerformanceInspectionService -> AndroidBatteryInspector : parse
156+ AndroidBatteryInspector -> PerformanceInspectionService : PerformanceTestResult
157+ PerformanceInspectionService -> WindowsBatteryInspector : parse
158+ WindowsBatteryInspector -> PerformanceInspectionService : PerformanceTestResult
159+ PerformanceInspectionService -> Runner : List<PerformanceTestResult>
160+ deactivate PerformanceInspectionService
161+ Runner -> ThreadParam : clean
162+ deactivate ThreadParam
163+ deactivate Runner
164+ @enduml
0 commit comments