doc-exports/docs/modelarts/api-ref/modelarts_03_0087.html
Lai, Weijian 2f0818cf3d ModelArts API 22.3.0 version-20240311
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lai, Weijian <laiweijian4@huawei.com>
Co-committed-by: Lai, Weijian <laiweijian4@huawei.com>
2024-04-05 09:35:42 +00:00

223 lines
16 KiB
HTML

<a name="modelarts_03_0087"></a><a name="modelarts_03_0087"></a>
<h1 class="topictitle1">Querying Service Monitoring Information</h1>
<div id="body1536317657211"><div class="section" id="modelarts_03_0087__section1543612115413"><h4 class="sectiontitle">Function</h4><p id="modelarts_03_0087__p2517918849">This API is used to query service monitoring information. </p>
</div>
<div class="section" id="modelarts_03_0087__section181341535122619"><h4 class="sectiontitle">URI</h4><p id="modelarts_03_0087__p12213418185619">GET /v1/{project_id}/services/{service_id}/monitor</p>
<div class="p" id="modelarts_03_0087__p86385208570"><a href="#modelarts_03_0087__table10624434011">Table 1</a> describes the required parameters.
<div class="tablenoborder"><a name="modelarts_03_0087__table10624434011"></a><a name="table10624434011"></a><table cellpadding="4" cellspacing="0" summary="" id="modelarts_03_0087__table10624434011" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameters</caption><thead align="left"><tr id="modelarts_03_0087__row13653412406"><th align="left" class="cellrowborder" valign="top" width="18.81188118811881%" id="mcps1.3.2.3.2.2.5.1.1"><p id="modelarts_03_0087__p8665404020">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15.841584158415841%" id="mcps1.3.2.3.2.2.5.1.2"><p id="modelarts_03_0087__p46614184018">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12.871287128712872%" id="mcps1.3.2.3.2.2.5.1.3"><p id="modelarts_03_0087__p668154124018">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="52.475247524752476%" id="mcps1.3.2.3.2.2.5.1.4"><p id="modelarts_03_0087__p469204194016">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="modelarts_03_0087__row1797617864917"><td class="cellrowborder" valign="top" width="18.81188118811881%" headers="mcps1.3.2.3.2.2.5.1.1 "><p id="modelarts_03_0087__p8780885181639">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.3.2.3.2.2.5.1.2 "><p id="modelarts_03_0087__p40163046181639">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="12.871287128712872%" headers="mcps1.3.2.3.2.2.5.1.3 "><p id="modelarts_03_0087__p31981288181639">String</p>
</td>
<td class="cellrowborder" valign="top" width="52.475247524752476%" headers="mcps1.3.2.3.2.2.5.1.4 "><p id="modelarts_03_0087__p40347522181639">Project ID. For details about how to obtain a project ID, see <a href="modelarts_03_0147.html">Obtaining a Project ID and Name</a>.</p>
</td>
</tr>
<tr id="modelarts_03_0087__row870174164011"><td class="cellrowborder" valign="top" width="18.81188118811881%" headers="mcps1.3.2.3.2.2.5.1.1 "><p id="modelarts_03_0087__p372348400">service_id</p>
</td>
<td class="cellrowborder" valign="top" width="15.841584158415841%" headers="mcps1.3.2.3.2.2.5.1.2 "><p id="modelarts_03_0087__p19736411406">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="12.871287128712872%" headers="mcps1.3.2.3.2.2.5.1.3 "><p id="modelarts_03_0087__p174643403">String</p>
</td>
<td class="cellrowborder" valign="top" width="52.475247524752476%" headers="mcps1.3.2.3.2.2.5.1.4 "><p id="modelarts_03_0087__p575194174011">Service ID</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="modelarts_03_0087__table118011654615" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameters</caption><thead align="left"><tr id="modelarts_03_0087__row128412615467"><th align="left" class="cellrowborder" valign="top" width="18.627450980392158%" id="mcps1.3.2.3.3.2.5.1.1"><p id="modelarts_03_0087__p198612613464">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15.686274509803921%" id="mcps1.3.2.3.3.2.5.1.2"><p id="modelarts_03_0087__p488116104612">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12.745098039215685%" id="mcps1.3.2.3.3.2.5.1.3"><p id="modelarts_03_0087__p5894684613">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="52.94117647058824%" id="mcps1.3.2.3.3.2.5.1.4"><p id="modelarts_03_0087__p139246154610">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="modelarts_03_0087__row17943614619"><td class="cellrowborder" valign="top" width="18.627450980392158%" headers="mcps1.3.2.3.3.2.5.1.1 "><p id="modelarts_03_0087__p19951767464">node_id</p>
</td>
<td class="cellrowborder" valign="top" width="15.686274509803921%" headers="mcps1.3.2.3.3.2.5.1.2 "><p id="modelarts_03_0087__p1098196194611">No</p>
</td>
<td class="cellrowborder" valign="top" width="12.745098039215685%" headers="mcps1.3.2.3.3.2.5.1.3 "><p id="modelarts_03_0087__p199917615466">String</p>
</td>
<td class="cellrowborder" valign="top" width="52.94117647058824%" headers="mcps1.3.2.3.3.2.5.1.4 "><p id="modelarts_03_0087__p181000684616">ID of the node to be obtained. By default, all nodes are obtained.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="modelarts_03_0087__section71456147333"><h4 class="sectiontitle">Request Body</h4><p id="modelarts_03_0087__p363816016013">None</p>
</div>
<div class="section" id="modelarts_03_0087__section54078976"><h4 class="sectiontitle">Response Body</h4><div class="p" id="modelarts_03_0087__p334315171906"><a href="#modelarts_03_0087__table413209485">Table 3</a> describes the response parameters.
<div class="tablenoborder"><a name="modelarts_03_0087__table413209485"></a><a name="table413209485"></a><table cellpadding="4" cellspacing="0" summary="" id="modelarts_03_0087__table413209485" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Parameters</caption><thead align="left"><tr id="modelarts_03_0087__row461520144819"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.2.2.4.1.1"><p id="modelarts_03_0087__p671720184814">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="22%" id="mcps1.3.4.2.2.2.4.1.2"><p id="modelarts_03_0087__p41062004818">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="57.99999999999999%" id="mcps1.3.4.2.2.2.4.1.3"><p id="modelarts_03_0087__p51317202481">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="modelarts_03_0087__row121442013482"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.2.4.1.1 "><p id="modelarts_03_0087__p1716122012489">service_id</p>
</td>
<td class="cellrowborder" valign="top" width="22%" headers="mcps1.3.4.2.2.2.4.1.2 "><p id="modelarts_03_0087__p418162011482">String</p>
</td>
<td class="cellrowborder" valign="top" width="57.99999999999999%" headers="mcps1.3.4.2.2.2.4.1.3 "><p id="modelarts_03_0087__p1819420164816">Service ID</p>
</td>
</tr>
<tr id="modelarts_03_0087__row92052015484"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.2.4.1.1 "><p id="modelarts_03_0087__p20221720114814">service_name</p>
</td>
<td class="cellrowborder" valign="top" width="22%" headers="mcps1.3.4.2.2.2.4.1.2 "><p id="modelarts_03_0087__p1023220104819">String</p>
</td>
<td class="cellrowborder" valign="top" width="57.99999999999999%" headers="mcps1.3.4.2.2.2.4.1.3 "><p id="modelarts_03_0087__p825162013488">Service name</p>
</td>
</tr>
<tr id="modelarts_03_0087__row92632004815"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.2.4.1.1 "><p id="modelarts_03_0087__p42818204484">monitors</p>
</td>
<td class="cellrowborder" valign="top" width="22%" headers="mcps1.3.4.2.2.2.4.1.2 "><p id="modelarts_03_0087__p731120134816"><strong id="modelarts_03_0087__b19496998816">monitor</strong> array corresponding to <strong id="modelarts_03_0087__b37955511581">infer_type</strong> of a service</p>
</td>
<td class="cellrowborder" valign="top" width="57.99999999999999%" headers="mcps1.3.4.2.2.2.4.1.3 "><p id="modelarts_03_0087__p83212019487">Monitoring details</p>
<ul id="modelarts_03_0087__ul68451277451"><li id="modelarts_03_0087__li178453278452">If <strong id="modelarts_03_0087__b65681961712">infer_type</strong> is set to <strong id="modelarts_03_0087__b135671931715">real-time</strong>, see <a href="#modelarts_03_0087__table974014115493">Table 4</a>.</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="modelarts_03_0087__table974014115493"></a><a name="table974014115493"></a><table cellpadding="4" cellspacing="0" summary="" id="modelarts_03_0087__table974014115493" frame="border" border="1" rules="all"><caption><b>Table 4 </b><strong id="modelarts_03_0087__b81785519115">monitor</strong> parameters of <strong id="modelarts_03_0087__b817820519116">real-time</strong></caption><thead align="left"><tr id="modelarts_03_0087__row9746151116491"><th align="left" class="cellrowborder" valign="top" width="19.801980198019802%" id="mcps1.3.4.2.3.2.4.1.1"><p id="modelarts_03_0087__p16747181134917">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13.861386138613863%" id="mcps1.3.4.2.3.2.4.1.2"><p id="modelarts_03_0087__p1374918110495">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="66.33663366336634%" id="mcps1.3.4.2.3.2.4.1.3"><p id="modelarts_03_0087__p12751411154913">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="modelarts_03_0087__row5753131154919"><td class="cellrowborder" valign="top" width="19.801980198019802%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="modelarts_03_0087__p775414117493">model_id</p>
</td>
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="modelarts_03_0087__p7756151110496">String</p>
</td>
<td class="cellrowborder" valign="top" width="66.33663366336634%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="modelarts_03_0087__p7758101113496">Model ID</p>
</td>
</tr>
<tr id="modelarts_03_0087__row14758111124914"><td class="cellrowborder" valign="top" width="19.801980198019802%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="modelarts_03_0087__p147601111496">model_name</p>
</td>
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="modelarts_03_0087__p14761111184916">String</p>
</td>
<td class="cellrowborder" valign="top" width="66.33663366336634%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="modelarts_03_0087__p10763151116498">Model name</p>
</td>
</tr>
<tr id="modelarts_03_0087__row47648112490"><td class="cellrowborder" valign="top" width="19.801980198019802%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="modelarts_03_0087__p876541119491">model_version</p>
</td>
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="modelarts_03_0087__p137672011124919">String</p>
</td>
<td class="cellrowborder" valign="top" width="66.33663366336634%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="modelarts_03_0087__p476921114917">Model version</p>
</td>
</tr>
<tr id="modelarts_03_0087__row67698116499"><td class="cellrowborder" valign="top" width="19.801980198019802%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="modelarts_03_0087__p127716113496">invocation_times</p>
</td>
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="modelarts_03_0087__p5773101184912">Long</p>
</td>
<td class="cellrowborder" valign="top" width="66.33663366336634%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="modelarts_03_0087__p14774131112495">Total number of model instance calls</p>
</td>
</tr>
<tr id="modelarts_03_0087__row19775911204916"><td class="cellrowborder" valign="top" width="19.801980198019802%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="modelarts_03_0087__p19776711144916">failed_times</p>
</td>
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="modelarts_03_0087__p5780201174916">Long</p>
</td>
<td class="cellrowborder" valign="top" width="66.33663366336634%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="modelarts_03_0087__p2782311144916">Number of failed model instance calls</p>
</td>
</tr>
<tr id="modelarts_03_0087__row37831811204911"><td class="cellrowborder" valign="top" width="19.801980198019802%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="modelarts_03_0087__p578561184910">cpu_core_usage</p>
</td>
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="modelarts_03_0087__p178731117493">Float</p>
</td>
<td class="cellrowborder" valign="top" width="66.33663366336634%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="modelarts_03_0087__p5789201117496">Number of used CPUs</p>
</td>
</tr>
<tr id="modelarts_03_0087__row77891011104917"><td class="cellrowborder" valign="top" width="19.801980198019802%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="modelarts_03_0087__p1479101124913">cpu_core_total</p>
</td>
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="modelarts_03_0087__p1793111116493">Float</p>
</td>
<td class="cellrowborder" valign="top" width="66.33663366336634%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="modelarts_03_0087__p12795121154912">Total number of CPUs</p>
</td>
</tr>
<tr id="modelarts_03_0087__row12796131124912"><td class="cellrowborder" valign="top" width="19.801980198019802%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="modelarts_03_0087__p1579711144916">cpu_memory_usage</p>
</td>
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="modelarts_03_0087__p13799151174913">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="66.33663366336634%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="modelarts_03_0087__p1580031124911">Used memory, in MB</p>
</td>
</tr>
<tr id="modelarts_03_0087__row8801161111494"><td class="cellrowborder" valign="top" width="19.801980198019802%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="modelarts_03_0087__p3802111164916">cpu_memory_total</p>
</td>
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="modelarts_03_0087__p168041111104914">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="66.33663366336634%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="modelarts_03_0087__p680611184914">Total memory, in MB</p>
</td>
</tr>
<tr id="modelarts_03_0087__row11807121113499"><td class="cellrowborder" valign="top" width="19.801980198019802%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="modelarts_03_0087__p4809121184912">gpu_usage</p>
</td>
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="modelarts_03_0087__p17810201194919">Float</p>
</td>
<td class="cellrowborder" valign="top" width="66.33663366336634%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="modelarts_03_0087__p198121011184910">Number used GPUs</p>
</td>
</tr>
<tr id="modelarts_03_0087__row1881341194918"><td class="cellrowborder" valign="top" width="19.801980198019802%" headers="mcps1.3.4.2.3.2.4.1.1 "><p id="modelarts_03_0087__p981510119492">gpu_total</p>
</td>
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.4.2.3.2.4.1.2 "><p id="modelarts_03_0087__p1481771144915">Float</p>
</td>
<td class="cellrowborder" valign="top" width="66.33663366336634%" headers="mcps1.3.4.2.3.2.4.1.3 "><p id="modelarts_03_0087__p281871154917">Total number of GPUs</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="modelarts_03_0087__section1810193414711"><h4 class="sectiontitle">Samples</h4><p id="modelarts_03_0087__p1626113524475">The following shows how to query the monitoring information about a real-time service.</p>
</div>
<ul id="modelarts_03_0087__ul11661134735818"><li id="modelarts_03_0087__li8663184755814">Sample request<pre class="screen" id="modelarts_03_0087__screen17210756125618">GET https://endpoint/v1/{project_id}/services/{service_id}/monitor</pre>
</li></ul>
<ul id="modelarts_03_0087__ul163453474715"><li id="modelarts_03_0087__li1533103454717">Sample response<pre class="screen" id="modelarts_03_0087__screen7636135570">{
"service_id": "xxx",
"service_name": "mnist",
"monitors":
[{
"model_id": "xxxx",
"model_name": "minst",
"model_version": "1.0.0",
"invocation_times": 50,
"failed_times": 1,
"cpu_core_usage": "2.4",
"cpu_core_total": "4",
"cpu_memory_usage": "2011",
"cpu_memory_total": "8192",
"gpu_usage": "0.6",
"gpu_total": "1"
} ]
}</pre>
</li></ul>
<div class="section" id="modelarts_03_0087__section16948739"><h4 class="sectiontitle">Status Code</h4><p id="modelarts_03_0087__p1731954913014">For details about the status code, see <a href="modelarts_03_0094.html#modelarts_03_0094__table1450010510213">Table 1</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="modelarts_03_0081.html">Service Management</a></div>
</div>
</div>