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

# PartyLocalEndpoint::GetEndpointStatistics

> 获取指定目标终结点的一个或多个统计计数器值。

获取指定目标终结点的一个或多个统计计数器值。

## Syntax

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

### Parameters

**`targetEndpointCount`**   uint32\_t

`targetEndpoints` 数组中目标终结点的数量。可以为 0 以检索当前网络中所有终结点（包括此本地终结点）的统计信息。

**`targetEndpoints`**   [PartyEndpointArray](/services/playfab/multiplayer/networking/reference/typedefs)\
*input array of size `targetEndpointCount`*

应为其检索统计信息的、包含 `targetEndpointCount` 个条目的目标 PartyEndpoint 对象指针数组。当 `targetEndpointCount` 为零时，将忽略此参数。

**`statisticCount`**   uint32\_t

`statisticTypes` 输入数组中的统计信息数量，也是要写入 `statisticValues` 输出数组中的统计信息数量。此值必须至少为 1。

**`statisticTypes`**   [PartyEndpointStatistic\*](/services/playfab/multiplayer/networking/reference/enums/partyendpointstatistic)\
*input array of size `statisticCount`*

要检索的、包含 `statisticCount` 个唯一 PartyEndpointStatistic 类型条目的输入数组。

**`statisticValues`**   uint64\_t\*\
*output array of size `statisticCount`*

应写入统计值的、包含 `statisticCount` 个条目的输出数组。每个统计值将写入与所请求的 PartyEndpointStatistic 在 `statisticTypes` 输入数组中出现位置对应的相同条目索引处。

### Return value

PartyError

如果检索终结点统计信息成功，则返回 `c_partyErrorSuccess`；否则返回错误代码。可通过 [PartyManager::GetErrorMessage()](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_geterrormessage) 检索错误代码的可读形式。

## Remarks

此方法用于检索在此本地终结点和目标终结点之间记录的性能计数器、队列长度、历史使用指标或其他统计信息。<br /><br /> 或者，可以提供多个目标终结点，或提供零条目数组以检索当前网络中所有目标终结点（包括此本地终结点）的统计信息。如果请求了多个目标终结点，则返回的值是这些终结点的组合统计信息。用于将多个终结点的统计信息组合为单个值的特定方法取决于并由特定的 PartyEndpointStatistic 类型描述。   <br /><br /> 给定的 PartyEndpointStatistic 类型可以按任何顺序出现在 `statisticTypes` 数组中，但不得多次指定。每个对应的统计值将按相同顺序写入 `statisticValues` 数组。   <br /><br /> 返回的统计值始终是可用的最新值。不能保证从一次 GetEndpointStatistics() 调用到下一次调用会报告相同的值，即使在这之间没有对 [PartyManager::StartProcessingStateChanges()](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_startprocessingstatechanges) 或 [PartyManager::FinishProcessingStateChanges()](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_finishprocessingstatechanges) 的调用。

## Requirements

**Header:** Party.h

## See also

[PartyLocalEndpoint](/services/playfab/multiplayer/networking/reference/classes/PartyLocalEndpoint/partylocalendpoint)\
[PartyEndpointStatistic](/services/playfab/multiplayer/networking/reference/enums/partyendpointstatistic)\
[PartyNetwork::GetNetworkStatistics](/services/playfab/multiplayer/networking/reference/classes/PartyNetwork/methods/partynetwork_getnetworkstatistics)


## Related topics

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