> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PartyLocalEndpoint::GetEndpointStatistics

> 取得指定目標端點的一或多個統計計數器值。

取得指定目標端點的一或多個統計計數器值。

## 語法

```cpp theme={null}
PartyError GetEndpointStatistics(  
    uint32_t targetEndpointCount,  
    PartyEndpointArray targetEndpoints,  
    uint32_t statisticCount,  
    const PartyEndpointStatistic* statisticTypes,  
    uint64_t* statisticValues  
)  
```

### 參數

**`targetEndpointCount`**   uint32\_t

`targetEndpoints` 陣列中的目標端點數目。可以為 0，以擷取網路中目前所有端點 (包括此本機端點) 的統計資料。

**`targetEndpoints`**   [PartyEndpointArray](https://docs.xbox.com/zh-TW/services/playfab/multiplayer/networking/reference/typedefs.md)\
*大小為 `targetEndpointCount` 的輸入陣列*

包含 `targetEndpointCount` 個項目的目標 PartyEndpoint 物件指標陣列，應擷取其統計資料。當 `targetEndpointCount` 為零時會忽略此參數。

**`statisticCount`**   uint32\_t

輸入 `statisticTypes` 陣列中的統計資料數目，也就是要寫入 `statisticValues` 輸出陣列的數目。至少必須為 1。

**`statisticTypes`**   [PartyEndpointStatistic\*](https://docs.xbox.com/zh-TW/services/playfab/multiplayer/networking/reference/enums/partyendpointstatistic.md)\
*大小為 `statisticCount` 的輸入陣列*

包含 `statisticCount` 個項目的輸入陣列，列出要擷取的唯一 PartyEndpointStatistic 類型。

**`statisticValues`**   uint64\_t\*\
*大小為 `statisticCount` 的輸出陣列*

包含 `statisticCount` 個項目的輸出陣列，統計值應寫入其中。每個統計值都會寫入與要求的 PartyEndpointStatistic 在 `statisticTypes` 輸入陣列中所在位置相對應的相同項目索引。

### 傳回值

PartyError

`c_partyErrorSuccess` (如果擷取端點統計資料成功)，否則為錯誤碼。可透過 [PartyManager::GetErrorMessage()](https://docs.xbox.com/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_geterrormessage.md) 擷取錯誤碼的人類可讀形式。

## 備註

此方法用於擷取在此本機端點與目標端點之間記錄的效能計數器、佇列長度、歷史使用量計量或其他統計資訊。 \
\
&#x20;或者，可以提供多個目標端點，或提供零個項目的陣列，以擷取網路中目前所有目標端點 (包括此本機端點) 的統計資料。如果要求多個目標端點，則傳回的值是這些端點的合併統計資料。將多個端點統計資料合併為單一值的具體方法，取決於特定的 PartyEndpointStatistic 類型並在其中說明。   \
\
&#x20;指定的 PartyEndpointStatistic 類型可以依任何順序出現在 `statisticTypes` 陣列中，但不得指定超過一次。每個對應的統計值都會以相同的順序寫入 `statisticValues` 陣列。   \
\
&#x20;傳回的統計值一律是目前可用的最新值。即使在兩次呼叫之間沒有呼叫 [PartyManager::StartProcessingStateChanges()](https://docs.xbox.com/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_startprocessingstatechanges.md) 或 [PartyManager::FinishProcessingStateChanges()](https://docs.xbox.com/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_finishprocessingstatechanges.md)，也不保證每次 GetEndpointStatistics() 呼叫都會回報相同的值。

## 需求

**標頭：** Party.h

## 另請參閱

[PartyLocalEndpoint](https://docs.xbox.com/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyLocalEndpoint/partylocalendpoint.md)\
[PartyEndpointStatistic](https://docs.xbox.com/zh-TW/services/playfab/multiplayer/networking/reference/enums/partyendpointstatistic.md)\
[PartyNetwork::GetNetworkStatistics](https://docs.xbox.com/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyNetwork/methods/partynetwork_getnetworkstatistics.md)


## Related topics

- [PartyEndpointStatistic](https://docs.xbox.com/zh-TW/services/playfab/multiplayer/networking/reference/enums/partyendpointstatistic.md)
- [PartyLocalEndpoint::SendMessage](https://docs.xbox.com/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyLocalEndpoint/methods/partylocalendpoint_sendmessage.md)
- [PartyNetworkStatistic](https://docs.xbox.com/zh-TW/services/playfab/multiplayer/networking/reference/enums/partynetworkstatistic.md)
- [PartyNetwork::GetNetworkStatistics](https://docs.xbox.com/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyNetwork/methods/partynetwork_getnetworkstatistics.md)
- [PartyDirectPeerConnectivityOptions](https://docs.xbox.com/zh-TW/services/playfab/multiplayer/networking/reference/enums/partydirectpeerconnectivityoptions.md)
