Monitor is a set of APIs integrated in MindStudio Monitor. You can call these APIs to start and stop performance monitoring and obtain monitoring data.
Install msMonitor. For details, see . You are advised to download the software package for installation.
Function
Provides easy-to-use APIs to collect profile data of compute operators, communication operators, APIs, Runtime APIs, and MSTX. You can select metrics to be collected as needed.
API Description
For details, see for mindstudio_monitor.
Example
Import the Monitor APIs to the model Python script.
[object Object]Call the Monitor APIs in the model Python script to start performance monitoring.
[object Object](Optional) Obtain profile data online. For details about the returned data structure, see .
[object Object](Optional) Save the profile data to a local file. Currently, only the Excel format is supported. For details about the file, see .
[object Object]
The output Excel file contains multiple sheets. Each sheet corresponds to a data type, such as API, kernel, and marker. You can view different sheets to analyze the execution time of operators and APIs.
See the following figure.
The fields on each sheet are described as follows:
[object Object]: mstx dotting message content[object Object]: message source type, either[object Object]or[object Object][object Object]: name of the domain to which the message belongs[object Object]: message ID[object Object]: mstx dotting start time, in microseconds[object Object]: mstx dotting end time, in microseconds[object Object]: process ID when[object Object]is[object Object], and[object Object]when[object Object]is[object Object][object Object]: thread ID when[object Object]is[object Object], and[object Object]when[object Object]is[object Object][object Object]: ID of the device to which the marker belongs when[object Object]is[object Object], or[object Object]when[object Object]is[object Object][object Object]: ID of the stream to which the marker belongs when[object Object]is[object Object], or[object Object]when[object Object]is[object Object][object Object]: mstx dotting execution time, in microseconds
[object Object]: name of a compute operator[object Object]: operator execution start time, in microseconds[object Object]: operator execution end time, in microseconds[object Object]: ID of the device where the operator is executed[object Object]: ID of the stream where the operator is executed[object Object]: operator execution correlation ID, which is used to associate with API data[object Object]: operator type, for example,[object Object],[object Object], or[object Object][object Object]: operator execution time, in microseconds
[object Object]: name of a communication operator[object Object]: operator execution start time, in microseconds[object Object]: operator execution end time, in microseconds[object Object]: ID of the device where the operator is executed[object Object]: ID of the stream where the operator is executed[object Object]: data volume transmitted by the operator[object Object]: data type transmitted by the operator, for example,[object Object]or[object Object][object Object]: name of the communicator to which the operator belongs[object Object]: communication algorithm type of the operator, for example,[object Object]or[object Object][object Object]: operator execution correlation ID, which is used to associate with API data[object Object]: operator execution time, in microseconds
[object Object]: API name[object Object]: API call start time, in microseconds[object Object]: API call end time, in microseconds[object Object]: ID of the process that calls the API[object Object]: ID of the thread that calls the API[object Object]: API call correlation ID, which is used to associate with kernel/communication data[object Object]: API call duration, in microseconds