forked from docs/doc-exports
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com> Co-authored-by: Chen, Junjie <chenjunjie@huawei.com> Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
72 lines
12 KiB
HTML
72 lines
12 KiB
HTML
<a name="functiongraph_01_0110"></a><a name="functiongraph_01_0110"></a>
|
|
|
|
<h1 class="topictitle1">Use of FunctionGraph</h1>
|
|
<div id="body32001227"><p id="functiongraph_01_0110__en-us_topic_0000001251907944_p14943529141713">FunctionGraph allows you to run your code without provisioning or managing servers, while ensuring high availability and scalability. All you need to do is upload your code and set execution conditions, and FunctionGraph will take care of the rest.</p>
|
|
<div class="section" id="functiongraph_01_0110__en-us_topic_0000001251907944_section19758931103620"><h4 class="sectiontitle">Process</h4><p id="functiongraph_01_0110__en-us_topic_0000001251907944_p1526763143616"><a href="#functiongraph_01_0110__en-us_topic_0000001251907944_fig24661772619">Figure 1</a> shows the process of using functions.</p>
|
|
<ol id="functiongraph_01_0110__en-us_topic_0000001251907944_ol14828112225116"><li id="functiongraph_01_0110__en-us_topic_0000001251907944_li66154933143153">Write code, package and upload it to FunctionGraph, and add event sources such as Simple Message Notification (SMN), Object Storage Service (OBS), and API Gateway (APIG) event sources to build applications.</li><li id="functiongraph_01_0110__en-us_topic_0000001251907944_li593315357514">Functions are triggered by RESTful API calls or event sources to achieve expected service purposes. During this process, FunctionGraph automatically schedules resources.</li><li id="functiongraph_01_0110__en-us_topic_0000001251907944_li3686256135112">View logs and metrics. Note that you will be billed based on code execution duration.<div class="fignone" id="functiongraph_01_0110__en-us_topic_0000001251907944_fig24661772619"><a name="functiongraph_01_0110__en-us_topic_0000001251907944_fig24661772619"></a><a name="en-us_topic_0000001251907944_fig24661772619"></a><span class="figcap"><b>Figure 1 </b>Flowchart</span><br><span><img id="functiongraph_01_0110__en-us_topic_0000001251907944_image5461317172614" src="en-us_image_0000001252067288.png"></span></div>
|
|
</li></ol>
|
|
<p id="functiongraph_01_0110__en-us_topic_0000001251907944_p62596142162959">The following shows the details:</p>
|
|
<p id="functiongraph_01_0110__en-us_topic_0000001251907944_p18188232182114"></p>
|
|
<ol id="functiongraph_01_0110__en-us_topic_0000001251907944_ol69402396508"><li id="functiongraph_01_0110__en-us_topic_0000001251907944_li1610523762117">Write code.<p id="functiongraph_01_0110__en-us_topic_0000001251907944_p1293375242118"><a name="functiongraph_01_0110__en-us_topic_0000001251907944_li1610523762117"></a><a name="en-us_topic_0000001251907944_li1610523762117"></a>Write code in Node.js, Python, Java, or Go.</p>
|
|
</li><li id="functiongraph_01_0110__en-us_topic_0000001251907944_li24851082211">Upload code.<p id="functiongraph_01_0110__en-us_topic_0000001251907944_p44892514224"><a name="functiongraph_01_0110__en-us_topic_0000001251907944_li24851082211"></a><a name="en-us_topic_0000001251907944_li24851082211"></a>Edit code inline, upload a local ZIP or JAR file, or upload a ZIP file from OBS. For details, see <a href="functiongraph_01_0152.html#functiongraph_01_0152">Creating a Deployment Package</a>.</p>
|
|
</li><li id="functiongraph_01_0110__en-us_topic_0000001251907944_li154513982210">Trigger functions by API calls or cloud service events.<p id="functiongraph_01_0110__en-us_topic_0000001251907944_p14818182911223"><a name="functiongraph_01_0110__en-us_topic_0000001251907944_li154513982210"></a><a name="en-us_topic_0000001251907944_li154513982210"></a>Functions are triggered by API calls or cloud service events. For details, see <a href="functiongraph_01_0200.html#functiongraph_01_0200">Creating Triggers</a>.</p>
|
|
</li><li id="functiongraph_01_0110__en-us_topic_0000001251907944_li19678101718236">Implement auto scaling.<p id="functiongraph_01_0110__en-us_topic_0000001251907944_p1369862442320"><a name="functiongraph_01_0110__en-us_topic_0000001251907944_li19678101718236"></a><a name="en-us_topic_0000001251907944_li19678101718236"></a>FunctionGraph implements auto scaling based on the number of requests. For details, see section "Notes and Constraints".</p>
|
|
</li><li id="functiongraph_01_0110__en-us_topic_0000001251907944_li12169132812314">View logs.<p id="functiongraph_01_0110__en-us_topic_0000001251907944_p1357093710238"><a name="functiongraph_01_0110__en-us_topic_0000001251907944_li12169132812314"></a><a name="en-us_topic_0000001251907944_li12169132812314"></a>View run logs of function. FunctionGraph is interconnected with Log Tank Service (LTS). For details, see <a href="functiongraph_01_1833.html#functiongraph_01_1833">Logs</a>.</p>
|
|
</li><li id="functiongraph_01_0110__en-us_topic_0000001251907944_li11189134117231">View monitoring information.<p id="functiongraph_01_0110__en-us_topic_0000001251907944_p1763155122316"><a name="functiongraph_01_0110__en-us_topic_0000001251907944_li11189134117231"></a><a name="en-us_topic_0000001251907944_li11189134117231"></a>View graphical monitoring information. FunctionGraph is interconnected with Cloud Eye. For details, see <a href="functiongraph_01_0211.html#functiongraph_01_0211">Metrics</a>.</p>
|
|
</li></ol>
|
|
</div>
|
|
<div class="section" id="functiongraph_01_0110__en-us_topic_0000001251907944_section123696302544"><h4 class="sectiontitle">Introduction to Dashboard</h4><div class="p" id="functiongraph_01_0110__en-us_topic_0000001251907944_p13986172671210">Log in to the FunctionGraph console and choose <strong id="functiongraph_01_0110__en-us_topic_0000001251907944_b163421614185119">Dashboard</strong> in the navigation pane on the left.<ul id="functiongraph_01_0110__en-us_topic_0000001251907944_ul81305165819"><li id="functiongraph_01_0110__en-us_topic_0000001251907944_li111308161884">View your created functions/function quota, used storage/storage quota, and monthly invocations and resource usage.<div class="fignone" id="functiongraph_01_0110__en-us_topic_0000001251907944_fig1886711153814"><span class="figcap"><b>Figure 2 </b>Monthly statistics</span><br><span><img id="functiongraph_01_0110__en-us_topic_0000001251907944_image286811151687" src="en-us_image_0000001629968978.png"></span></div>
|
|
</li><li id="functiongraph_01_0110__en-us_topic_0000001251907944_li173910182">View tenant-level metrics, including invocations, errors, duration, and throttles.<p id="functiongraph_01_0110__en-us_topic_0000001251907944_p47345027152647"><a name="functiongraph_01_0110__en-us_topic_0000001251907944_li173910182"></a><a name="en-us_topic_0000001251907944_li173910182"></a><a href="#functiongraph_01_0110__en-us_topic_0000001251907944_table34086103152643">Table 1</a> describes the function metrics.</p>
|
|
|
|
<div class="tablenoborder"><a name="functiongraph_01_0110__en-us_topic_0000001251907944_table34086103152643"></a><a name="en-us_topic_0000001251907944_table34086103152643"></a><table cellpadding="4" cellspacing="0" summary="" id="functiongraph_01_0110__en-us_topic_0000001251907944_table34086103152643" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Function metrics</caption><thead align="left"><tr id="functiongraph_01_0110__en-us_topic_0000001251907944_row45907106152643"><th align="left" class="cellrowborder" valign="top" width="13.525252525252524%" id="mcps1.3.3.2.2.2.2.2.4.1.1"><p id="functiongraph_01_0110__en-us_topic_0000001251907944_p46066664152643">Metric</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="9.646464646464645%" id="mcps1.3.3.2.2.2.2.2.4.1.2"><p id="functiongraph_01_0110__en-us_topic_0000001251907944_p40412270152643">Unit</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="76.82828282828284%" id="mcps1.3.3.2.2.2.2.2.4.1.3"><p id="functiongraph_01_0110__en-us_topic_0000001251907944_p52168437152643">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="functiongraph_01_0110__en-us_topic_0000001251907944_row66862752152643"><td class="cellrowborder" valign="top" width="13.525252525252524%" headers="mcps1.3.3.2.2.2.2.2.4.1.1 "><p id="functiongraph_01_0110__en-us_topic_0000001251907944_p47173835152643">Invocations</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9.646464646464645%" headers="mcps1.3.3.2.2.2.2.2.4.1.2 "><p id="functiongraph_01_0110__en-us_topic_0000001251907944_p62984266152643">Count</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="76.82828282828284%" headers="mcps1.3.3.2.2.2.2.2.4.1.3 "><p id="functiongraph_01_0110__en-us_topic_0000001251907944_p1451910152643">Total number of invocation requests, including invocation errors and throttled invocations. In case of asynchronous invocation, the count starts only when a function is executed in response to a request.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_0110__en-us_topic_0000001251907944_row66766826144056"><td class="cellrowborder" valign="top" width="13.525252525252524%" headers="mcps1.3.3.2.2.2.2.2.4.1.1 "><p id="functiongraph_01_0110__en-us_topic_0000001251907944_p3685282414413">Duration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9.646464646464645%" headers="mcps1.3.3.2.2.2.2.2.4.1.2 "><p id="functiongraph_01_0110__en-us_topic_0000001251907944_p3228878814413">ms</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="76.82828282828284%" headers="mcps1.3.3.2.2.2.2.2.4.1.3 "><p id="functiongraph_01_0110__en-us_topic_0000001251907944_p10625200257"><strong id="functiongraph_01_0110__en-us_topic_0000001251907944_b17392041145913">Maximum duration</strong>: the maximum duration all functions are executed at a time within a period.</p>
|
|
<p id="functiongraph_01_0110__en-us_topic_0000001251907944_p116332020250"><strong id="functiongraph_01_0110__en-us_topic_0000001251907944_b2004168857105637">Minimum duration</strong>: the minimum duration all functions are executed at a time within a period.</p>
|
|
<p id="functiongraph_01_0110__en-us_topic_0000001251907944_p463172092520"><strong id="functiongraph_01_0110__en-us_topic_0000001251907944_b513975193105637">Average duration</strong>: the average duration all functions are executed at a time within a period.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_0110__en-us_topic_0000001251907944_row13067190152643"><td class="cellrowborder" valign="top" width="13.525252525252524%" headers="mcps1.3.3.2.2.2.2.2.4.1.1 "><p id="functiongraph_01_0110__en-us_topic_0000001251907944_p51809431152643">Errors</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9.646464646464645%" headers="mcps1.3.3.2.2.2.2.2.4.1.2 "><p id="functiongraph_01_0110__en-us_topic_0000001251907944_p35814377152643">Count</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="76.82828282828284%" headers="mcps1.3.3.2.2.2.2.2.4.1.3 "><p id="functiongraph_01_0110__en-us_topic_0000001251907944_p15283411152643">Number of times that your functions failed with error code <strong id="functiongraph_01_0110__en-us_topic_0000001251907944_b2140992511105637">200</strong> being returned. Errors caused by function syntax or execution are also included.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_0110__en-us_topic_0000001251907944_row19350802152643"><td class="cellrowborder" valign="top" width="13.525252525252524%" headers="mcps1.3.3.2.2.2.2.2.4.1.1 "><p id="functiongraph_01_0110__en-us_topic_0000001251907944_p23911119152643">Throttles</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9.646464646464645%" headers="mcps1.3.3.2.2.2.2.2.4.1.2 "><p id="functiongraph_01_0110__en-us_topic_0000001251907944_p57752468152643">Count</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="76.82828282828284%" headers="mcps1.3.3.2.2.2.2.2.4.1.3 "><p id="functiongraph_01_0110__en-us_topic_0000001251907944_p47438346152643">Number of times that FunctionGraph throttles your functions due to the resource limit.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="functiongraph_01_0100.html">Before You Start</a></div>
|
|
</div>
|
|
</div>
|
|
|