forked from docs/doc-exports
Reviewed-by: Mützel, Andrea <andrea.muetzel@t-systems.com> Co-authored-by: liusiying01 <liusiying@huawei.com> Co-committed-by: liusiying01 <liusiying@huawei.com>
80 lines
14 KiB
HTML
80 lines
14 KiB
HTML
<a name="functiongraph_01_0110"></a><a name="functiongraph_01_0110"></a>
|
|
|
|
<h1 class="topictitle1">Process of Using FunctionGraph</h1>
|
|
<div id="body8662426"><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>
|
|
<p id="functiongraph_01_0110__en-us_topic_0000001251907944_p6247740204">To quickly create a function using FunctionGraph, do as follows:</p>
|
|
<p id="functiongraph_01_0110__en-us_topic_0000001251907944_p176926002217"><span><img id="functiongraph_01_0110__en-us_topic_0000001251907944_image19692180112213" src="en-us_image_0000002024507229.png"></span></p>
|
|
<ol id="functiongraph_01_0110__en-us_topic_0000001251907944_ol1551061381"><li id="functiongraph_01_0110__en-us_topic_0000001251907944_li1355765815">Set permissions: Ensure that you have the <strong id="functiongraph_01_0110__en-us_topic_0000001251907944_b025819568430">FunctionGraph FullAccess</strong> permissions.</li><li id="functiongraph_01_0110__en-us_topic_0000001251907944_li7265632487">Create a function: Create a function from scratch or using the sample code or a container image.</li><li id="functiongraph_01_0110__en-us_topic_0000001251907944_li16603553126">Configure the function: Configure the code source or modify other parameters.</li><li id="functiongraph_01_0110__en-us_topic_0000001251907944_li779454618820">Test the function: Create a test event to debug the function.</li><li id="functiongraph_01_0110__en-us_topic_0000001251907944_li1278114497819">View the execution result: On the function details page, view the execution result based on the configured test event.</li><li id="functiongraph_01_0110__en-us_topic_0000001251907944_li11721817993">View metrics: On the <strong id="functiongraph_01_0110__en-us_topic_0000001251907944_b15753359114411">Monitoring</strong> tab page of the function details page, view function metrics.</li></ol>
|
|
<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) 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" title="Click to enlarge" class="imgResize"></span></div>
|
|
</li></ol>
|
|
<p id="functiongraph_01_0110__en-us_topic_0000001251907944_p62596142162959">The following shows the details:</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, C#, PHP, 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">Configuring Code</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">Configuring 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_1834.html#functiongraph_01_1834">Managing Function 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_0212.html#functiongraph_01_0212">Viewing FunctionGraph Metrics</a>.</p>
|
|
</li></ol>
|
|
</div>
|
|
<div class="section" id="functiongraph_01_0110__en-us_topic_0000001251907944_section123696302544"><a name="functiongraph_01_0110__en-us_topic_0000001251907944_section123696302544"></a><a name="en-us_topic_0000001251907944_section123696302544"></a><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" title="Click to enlarge" class="imgResize"></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.6.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.6.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.6.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.6.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.6.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.6.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.6.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.6.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.6.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.6.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.6.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.6.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.6.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.6.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.6.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>
|
|
|
|
|
|
<script language="JavaScript">
|
|
<!--
|
|
image_size('.imgResize');
|
|
var msg_imageMax = "view original image";
|
|
var msg_imageClose = "close";
|
|
//--></script> |