监控指标
- 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
测试方式为结果为:
使用curl 命令调用 endpoint 和 key文章来源:https://www.toymoban.com/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).文章来源地址https://www.toymoban.com/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.
到了这里,关于为Azure Cognitive Services创建一个metric指标监控的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!