The File Access Profiler module displays information about the file activity in your application, such as the number of read or write operations Unity performs or the number of file handles open, either for a specific frame or across all frames in a capture. You can use this information to help determine how efficiently your application performs file operations. This module can capture information about file operations on any file within your built application’s folder structure, or within your Unity project folder if you run the Profiler in the Unity Editor. This module is not enabled by default. To enable the File Access Profiler module, open the Profiler window, select the Profiler Modules dropdown menu, and toggle the File Access checkbox.
The File Access Profiler module’s chart is divided into five categories. To change the order of the categories in the chart, drag and drop them in the chart’s legend. You can also click a category’s colored legend to toggle its display on or off. For more information on how to use the Profiler window, see Getting started with the Profiler window. This module doesn’t collect information about unsuccessful file operations. If a file operation attempt is unsuccessful, Unity displays an error.
图表 | 描述 |
---|---|
Files Opened | The total number of files successfully opened in the local file system this frame. |
Files Closed | The total number of files successfully closed in the local file system this frame. |
File Seeks | The number of file seek operations performed in the local file system this frame. A file seek operation involves a search through the contents of a file. |
Reads in Flight | The total number of read operations that were in progress during this frame. |
File Handles Open | The total number of file handles held open at any time during this frame. This includes files that Unity opens and closes within the same frame. |
When you select a frame in the File Access Profiler module, the module details pane displays detailed information about files that Unity accessed during the capture. The File Access Profiler module has two views:
Use the dropdown menu at the top-left of the details pane to toggle which view is active. By default, the File Summary view is active.
Both views can display information for either a single selected frame, or for all frames in the capture. Use the second dropdown menu at the top-left of the details pane to choose between a single frame or all frames. This module doesn’t populate the details pane automatically. Instead, you need to select the Analyze Markers button at the top of the details pane to populate the view with data.
The File Summary view displays a summary of all file access operations that happened to each file during the capture. One entry in the table represents the full summary for a single file.
The table below describes all possible columns that the File Summary view table can display. Not all columns are enabled by default; to enable or disable a column, right-click anywhere in the row that contains the column headers to open a menu. Use this menu to toggle any column on or off.
详细信息 | 描述 | Enabled by default |
---|---|---|
Filename | The name of the file that was accessed. | 是 |
Total Bytes Read | The total number of bytes of information Unity read from this file during the selected frames. | 是 |
Read Access Time (ms) | The total time Unity spent performing reads from this file during the selected frames. | 是 |
Access Count | The total number of accesses of any type to this file during the selected frames. | 是 |
First Frame | The first frame that Unity accessed this file on. | 是 |
Number of Frames | The total number of frames that Unity accessed this file on. | 是 |
ID | An index that represents the order of execution of the file access markers. | 否 |
Read Bandwidth (MBps) | The average bandwidth of read operations on this file over the selected frames, in megabytes per second. | 否 |
Open Count | Total number of opening operations on this file during the selected frames. | 否 |
Close Count | Total number of closing operations on this file during the selected frames. | 否 |
Read Count | Total number of read operations on this file during the selected frames. | 否 |
Write Count | Total number of write operations on this file during the selected frames. | 否 |
Seek Count | Total number of file seek operations on this file during the selected frames. | 否 |
Total Bytes Written | The total number of bytes Unity wrote to this file during the selected frames. | 否 |
Write Bandwidth (MBps) | The average bandwidth of write operations on this file over the selected frames, in megabytes per second. | 否 |
Open Access Time (ms) | The total time Unity spent performing opening operations on this file during the selected frames, in milliseconds. | 否 |
Close Access Time (ms) | The total time Unity spent performing close operations on this file during the selected frames, in milliseconds. | 否 |
Write Access Time (ms) | The total time Unity spent performing write operations to this file during the selected frames, in milliseconds. | 否 |
Total Access Time (ms) | The total time Unity spent accessing this file during the selected frames, in milliseconds. | 否 |
The Accesses view provides detailed information about every file access operation in the capture. Each entry in the table in the details pane of the Profiler represents a single file access operation to a single file. The below table describes all possible columns that the Accesses view can display.
详细信息 | 描述 | Enabled by default |
---|---|---|
Index | An ID number that represents the order in which Unity performed the access operations. | 是 |
Filename | The name of the accessed file during this operation. To see the file path in full, hover your cursor over the filename entry. | 是 |
Type | The type of access operation performed. This can be either Open, Close, Seek, Read, or Write. | 是 |
Access Size | The number of bytes transferred during the access, where the access was a read or write. Where the access was a file seek, the size is the destination offset. | 是 |
Offset | The (starting) offset of the file access. | 是 |
Duration (ms) | The time taken to perform this access, in milliseconds. | 是 |
Average Bandwidth (MBps) | The average bandwidth for this access, where the access type was a read. | 是 |
First Frame Index | The ID of the frame this access began on. | 是 |
Frames | The total number of frames this access occurred for. | 是 |
Thread | The thread the access occurred on. | 是 |
Timestamp (ms) | The time this access started, relative to the start of the profiler capture. | 否 |
You can right-click on any of the file access markers to open a sub-menu with additional options to explore the data. The available options are as follows:
属性 | 功能 |
---|---|
Show marker in timeline view | Opens this marker in the CPU Usage Profiler module. |
Go to the first frame of this marker | Selects the frame in which the marker first appears in the chart. This option is disabled if the marker only appears on one frame. |
Go to the last frame of this marker | Selects the frame in which this marker last appears in the chart. This option is disabled if the marker only appears on one frame. |
Filter the view to this file path | Populates the search bar with the contents of the Filename column to filter the results. |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.