Navigate the Timeline Pane

Navigate the Timeline Pane

他最突出的部分跟踪文件的时间窗格,提出各仪器收集的数据的基于时间的视图(参见图11-1)。这个窗格可以很容易地在你的应用程序中发现趋势和潜在问题领域。例如,内存使用图中的一个尖峰表示应用程序分配的内存比平常多。这个峰值可能是正常的,或者可能表明您的代码创建了比预期的更多的对象或内存缓冲区。诸如泄漏之类的工具也可以识别应用程序不正确处理内存的地方。如果泄漏时间线跟踪是人烟稀少,你知道你的应用程序是正确的行为。如果磁道不是空的,您可能要检查为什么。The most prominent portion of a trace document is the timeline pane, which presents a time-based view of the data gathered by each instrument (see Figure 11-1). This pane makes it easy to spot trends and potential problem areas in your app at a glance. For example, a spike in a memory usage graph indicates a time when your app allocated more memory than usual. This spike might be normal, or it might indicate that your code created more objects or memory buffers than you anticipated. An instrument such as Leaks can also identify where your app is not handling memory properly. If the Leaks timeline track is sparsely populated, you know that your app is behaving properly. If the track is not empty, you might want to examine why.

Figure 11-1跟踪文档的时间线窗格The timeline pane of a trace document

下面的部分将提供关于时间轴窗格的更多信息,以及如何配置它。The sections that follow provide more information about the timeline pane and how you configure it.

放大缩小Zoom In and Out

如果你已经俘获了大量的跟踪数据,你可以扩大或缩小在时间线面板的详细介绍,让您专注于特定的数据集(参见图11-2)。If you’ve captured a lot of data with a trace, you can expand or contract the detail presented in the timeline pane, allowing you to focus in on a specific subset of data (see Figure 11-2).

Figure 11-2缩放到跟踪文档的时间线窗格中。Zooming into the timeline pane of a trace document

放大和缩小数据To zoom in and out of your data

做以下其中之一:Do one of the following:

  • 要放大或缩小,捏的触控板。To zoom in or out, pinch the trackpad.
  • 若要放大或缩小,请使用滚动轮,同时按下位于轨道视图上的指针按下选项键。To zoom in or out, use the scroll wheel while pressing the Option key with the pointer positioned over the track view.
  • 若要放大,请按选项键,并拖动希望隔离的数据部分。To zoom in, press the Option key, and drag across the section of data you wish to isolate.
  • 若要缩小,请按下控制键,并拖动一段数据。To zoom out, press the Control key, and drag across a section of data.

使所有记录的数据符合时间线To fit all recorded data in the timeline

  1. Choose View > Snap Track To Fit (or press Control-Command-Z).

增加时间轴中显示的数据的大小。To increase the size of the data displayed in the timeline

  1. Choose View > Increase Deck Size (or press Command-Plus Sign).

    当前选择的仪器的轨道高度增加,允许您更详细地查看它。The track for the currently selected instrument increases in height, allowing you to view it in greater detail.

减少时间轴中显示的数据的大小。To decrease the size of the data displayed in the timeline

  1. Choose View > Decrease Deck Size (or press Command-Minus Sign).

    The track for the currently selected instrument decreases in height.

Filter a Range of Data

仪器收集大量的信息,因为它的配置文件。您可以通过设置“详细信息”窗格来快速过滤此数据,以便只显示在特定时间范围内发生的事件。见图11-3。Instruments collects massive amounts of information as it profiles. You can quickly filter this data by setting the detail pane to show only events that occurred within a specific time range. See Figure 11-3.

Figure 11-3Selecting a range of data in the timeline pane of a trace document

选择检查的时间范围To select a time range for inspection

  1. 在不使用任何修饰符键的情况下拖动一段数据。只显示您拖动的数据。Drag across a section of data without using any modifier keys. Only the data you drag across is displayed.

仪表突出显示时间线窗格的内容,该窗格位于指定的范围内。Instruments highlights the contents of the timeline pane that fall within the range you specified.

清除检查范围To clear an inspection range

Do one of the following:

  • Click outside the selected range in the timeline pane.
  • Choose View > Clear Inspection Range.

Set Flags

标志允许你快速访问在时间线面板的兴趣点(参见图11-4)。可以向每个标志添加名称和说明。Flags allow you to quickly access points of interest in the timeline pane (see Figure 11-4). You can add a name and description to each flag.

Figure 11-4Flags in the timeline pane of a trace document

设置一个标记在时间轴面板当前播放头位置To set a flag at the current playhead position in the timeline pane

  1. Choose Edit > Add Flag (or press Command-Down Arrow).

在时间线标志之间导航To navigate between your timeline flags

  1. Choose Window > Manage Flags (or press Shift-Command-T) to display the Flags palette.

  2. 单击标志面板中的一个标志,在时间轴窗格中导航到它。Click a flag in the Flags palette to navigate to it in the timeline pane.

To delete a flag

  1. Drag the flag out of the timeline navigation bar.

To hide a flag

  1. Choose Window > Manage Flags (or press Shift-Command-T) to display the Flags palette.

  2. Deselect the checkbox next to a flag in the Flags palette to hide it in the timeline pane.

多次运行访问跟踪数据Access Trace Data for Multiple Runs

跟踪文件可以记录数据在你的应用程序运行多个,如图11-5所示。这样做时,它不会丢弃先前记录的数据。A trace document can record data over multiple runs of your app, as shown in Figure 11-5. When doing so, it doesn’t discard previously recorded data.

Figure 11-5在跟踪文档的时间线窗格中查看多个运行Viewing multiple runs in the timeline pane of a trace document

查看选定工具的运行列表To view a list of runs for a selected instrument

  1. 单击策略窗格中工具左侧的“披露三角形”。Click the disclosure triangle to the left of the instrument in the strategy pane.

    该工具展开显示一个运行列表。The instrument expands to display a list of runs.

查看选定工具的运行数据To view the run data for a selected instrument

  1. 单击策略窗格中工具左侧的“披露三角形”。Click the disclosure triangle to the left of the instrument in the strategy pane.
  2. 在时间线窗格中选择所需的运行轨迹。Select the desired run’s track in the timeline pane.

移动到所选仪器的下一个运行To move to the next run for the selected instrument

  1. Choose Instrument > Next Run, or press Command-Single Quotation Mark (‘).

移动到选定工具的前一个运行To move to the previous run for the selected instrument

  1. Choose Instrument > Previous Run, or press Command-Quotation Mark (").

时间: 2024-10-12 17:11:28

Navigate the Timeline Pane的相关文章

Navigate the Detail Pane

导航详细窗格Navigate the Detail Pane 在你发现在时间轴面板潜在的问题区域,使用详细信息窗格中检查该地区的数据(见图12-1)."详细信息"窗格显示与所选工具的当前跟踪运行相关联的数据.工具在细节窗格中每次只显示一个工具,因此您必须选择不同的工具才能看到不同的细节集.After you identify a potential problem area in the timeline pane, use the detail pane to examine the

Instruments User Guide编程指南2-Common Tasks

Launch Instruments  Instruments app在Xcode app的内部,所以最直接的方式启动Instruments就是从Xcode中启动,当然也可以间接通过 Dock, Launchpad,  command line等工具启动. Launch Instruments from Xcode 1:Open Xcode. 2:Choose Xcode > Open Developer Tool > Instruments. 建议:也能够使用该方式启动更多有用的开发工具 T

Getting Around Instruments

Getting Around Instruments Instruments has several key windows and dialogs. Profiling Template Selection Dialog When Instruments launches, you're presented with a list of profiling templates-files containing sets of preconfigured instruments-from whi

Monitor Network and File I/O

监控网络和文件输入输出Monitor Network and File I/O 工具提供了几个分析模板,用于监视应用程序的网络和文件I/O活动.Instruments provides several profiling templates that monitor your app's network and file I/O activity. 使用活动监视器跟踪整个网络和磁盘使用Use Activity Monitor to Track Overall Network and Disk U

Measure CPU Use

衡量CPU的使用Measure CPU Use 有效地使用CPU可以使应用程序更快更有效地运行.尽管您正在为特定平台编写应用程序,但请记住,即使是相同的通用平台也有不同的CPU能力.工具帮助您在各种条件下进行测试,从而使您能够确定应用程序使用多个核心.线程和其他资源有多好.Effective use of the CPU allows your app to run faster and more effectively. Although you are writing an app for

Measure Graphics Performance

测量的图形性能Measure Graphics Performance 在iOS应用程序中广泛使用图形可以使你的应用脱颖而出.但是,除非你负责任地使用图形资源,否则你的应用程序会慢下来,降低电池寿命,看起来平庸,不管你想渲染的内容有多好.最佳图形性能:Extensive use of graphics in your iOS app can make your app stand out from your competitors. But unless you use graphics res

About Data Analysis

About Data Analysis 工具不能解决代码中的问题.它可以帮助你更好地了解你的代码正在做什么,通过捕捉应用程序运行时的详细统计信息,并将它们呈现给你进行分析.由于每个应用程序都不同,查找和解决问题的实际步骤各不相同.因此,您必须学习如何通过过滤不需要的数据来解释信息工具,并钻入与应用程序相关的数据.然后,您必须执行一些检查工作,将您识别的任何数据与应用程序中的代码关联起来,这样您就可以进行改进.Instruments doesn't fix problems with your c

Access and Use Individual Instruments

Access and Use Individual Instruments 在跟踪文档中,称为工具的单个数据收集模块随着时间的推移收集有关应用程序.进程或设备的数据.每个工具收集并显示特定类型的信息,如文件访问.内存使用或网络活动.仪器包括大量的仪器库,这些仪器是为了满足大多数开发人员的需要而设计的.高级开发人员,但也可以开发自己的自定义工具,使用DTrace来收集其他数据.Within a trace document, individual data collection modules k

Record, Pause, and Stop Traces

Record, Pause, and Stop Traces 仪器在运行时收集有关应用程序的信息.本章介绍如何指导仪器收集信息.Instruments collects information about your app while it's running. This chapter describes how to direct instruments to collect information. 记录跟踪Record a Trace 当你准备好你的应用程序时,你开始录制.在记录时,跟踪