Skip to content

Commit 73185aa

Browse files
committed
1 parent 2b46bcf commit 73185aa

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lib/appium_lib_core/ios/xcuitest/device.rb

+12-2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ module Device
6767
# @param [String] profile_name: The name of existing performance profile to apply.
6868
# Execute `instruments -s` to show the list of available profiles.
6969
# 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).
7075
# @return nil
7176
#
7277
# @example
@@ -142,8 +147,13 @@ def background_app(duration = 0)
142147

143148
def add_performance
144149
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
147157
end
148158
end
149159

0 commit comments

Comments
 (0)