

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 管道指標範例
<a name="monitor-response"></a>

當您將 Amazon Personalize Search Ranking 外掛程式套用至 OpenSearch 查詢時，您可以透過取得搜尋管道的指標來監控外掛程式。管道指標包含統計資料，例如`personalized_search_ranking`回應處理器的失敗請求數。

 下列程式碼顯示從 OpenSearch 傳回的管道指標摘錄。它只會顯示包含兩個不同管道統計資料的`pipelines`物件。對於每個管道，您可以在`personalized_search_ranking`回應處理器清單中找到 Amazon Personalize Search Ranking 外掛程式指標。如需所有指標的完整範例，請參閱[搜尋管道指標](https://opensearch.org/docs/latest/search-plugins/search-pipelines/search-pipeline-metrics/)。

```
{
....
....
  "pipelines": {
    "pipelineA": {
      "request": {
        "count": 0,
        "time_in_millis": 0,
        "current": 0,
        "failed": 0
      },
      "response": {
        "count": 6,
        "time_in_millis": 2246,
        "current": 0,
        "failed": 0
      },
      "request_processors": [],
      "response_processors": [
        {
          personalized_search_ranking": {
            "type": "personalized_search_ranking",
            "stats": {
              "count": <number of requests>,
              "time_in_millis": <time>,
              "current": 0,
              "failed": <number of failed requests>
            }
          }
        }
      ]
    },
    "pipelineB": {
      "request": {
        "count": 0,
        "time_in_millis": 0,
        "current": 0,
        "failed": 0
      },
      "response": {
        "count": 8,
        "time_in_millis": 2248,
        "current": 0,
        "failed": 0
      },
      "request_processors": [],
      "response_processors": [
        {
          "personalized_search_ranking": {
            "type": "personalized_search_ranking",
            "stats": {
              "count": <number of requests>,
              "time_in_millis": <time>,
              "current": 0,
              "failed": <number of failed requests>
            }
          }
        }
      ]
    }
  }
....
....
}
```