監(jiān)控指標(biāo)
- In the Azure portal, in the page for your cognitive services resource, select?Metrics?(in the?Monitoring?section).
- If there is no existing chart, select?+ New chart. Then in the?Metric?list, review the possible metrics you can visualize and select?Total Calls.
- In the?Aggregation?list, select?Count. This will enable you to monitor the total calls to you Cognitive Service resource; which is useful in determining how much the service is being used over a period of time.
- To generate some requests to your cognitive service, you will use?curl?- a command line tool for HTTP requests. In Visual Studio Code, in the?03-monitor?folder, open?rest-test.cmd?and edit the?curl?command it contains (shown below), replacing?<yourEndpoint>?and?<yourKey>?with your endpoint URI and?Key1?key to use the Text Analytics API in your cognitive services resource.
- Save your changes, and then in the integrated terminal for the?03-monitor?folder, run the following command: rest-test?
測試方式為結(jié)果為:
使用curl 命令調(diào)用 endpoint 和 key文章來源:http://www.zghlxwxcb.cn/news/detail-490408.html
curl -X POST "<yourEndpoint>/text/analytics/v3.1/languages?" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: <yourKey>" --data-ascii "{'documents': [{'id':1,'text':'hello'}]}"
The command returns a JSON document containing information about the language detected in the input data (which should be English).文章來源地址http://www.zghlxwxcb.cn/news/detail-490408.html
- Re-run the?rest-test?command multiple times to generate some call activity (you can use the?^?key to cycle through previous commands).
- Return to the?Metrics?page in the Azure portal and refresh the?Total Calls?count chart. It may take a few minutes for the calls you made using?curl?to be reflected in the chart - keep refreshing the chart until it updates to include them.
到了這里,關(guān)于為Azure Cognitive Services創(chuàng)建一個(gè)metric指標(biāo)監(jiān)控的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!