File tree 1 file changed +12
-2
lines changed
lib/appium_lib_core/ios/xcuitest
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,11 @@ module Device
67
67
# @param [String] profile_name: The name of existing performance profile to apply.
68
68
# Execute `instruments -s` to show the list of available profiles.
69
69
# Note, that not all profiles are supported on mobile devices.
70
+ # @param [Integer|String] pid: The ID of the process to measure the performance for.
71
+ # Set it to `current` in order to measure the performance of
72
+ # the process, which belongs to the currently active application.
73
+ # All processes running on the device are measured if
74
+ # pid is unset (the default setting).
70
75
# @return nil
71
76
#
72
77
# @example
@@ -142,8 +147,13 @@ def background_app(duration = 0)
142
147
143
148
def add_performance
144
149
Appium ::Core ::Device . add_endpoint_method ( :start_performance_record ) do
145
- def start_performance_record ( timeout : 300_000 , profile_name : 'Activity Monitor' )
146
- execute_script 'mobile: startPerfRecord' , { timeout : timeout , profileName : profile_name }
150
+ def start_performance_record ( timeout : 300_000 , profile_name : 'Activity Monitor' , pid : nil )
151
+ option = { }
152
+ option [ :timeout ] = timeout
153
+ option [ :profileName ] = profile_name
154
+ option [ :pid ] = pid if pid
155
+
156
+ execute_script 'mobile: startPerfRecord' , option
147
157
end
148
158
end
149
159
You can’t perform that action at this time.
0 commit comments