> ## 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.

# 在游戏中显示队列统计信息

> 查询并显示 PlayFab Matchmaking 队列统计信息(如工单数量和等待时间),为搜索对局的玩家提供反馈。

游戏有时可能希望展示其队列的活跃程度,以便为用户设定关于等待时间的预期。他们可以检索这些统计信息并直接向用户显示,或者从服务器检索这些统计信息以进行显示,或按需收集近似的遥测数据。本教程展示了从匹配中检索这些统计信息的步骤。

## 配置你的队列

首先,决定是否应将队列配置为允许用户检索统计信息。服务器始终可以检索每个队列的统计信息。仅当队列配置勾选了**显示正在匹配的玩家数量**和/或**显示匹配用时统计信息**设置时,用户才可以检索统计信息。

具有此配置的队列示例可在 [Matchmaking 配置示例](https://docs.xbox.com/zh-CN/services/playfab/multiplayer/matchmaking/config-examples.md#enabling-statistics)中找到。

## 检索统计信息

调用 [GetQueueStatistics](xref:titleid.playfabapi.com.multiplayer.matchmaking.getqueuestatistics) API 以检索统计信息。这些值会随时间进行聚合和更新。因此,应仅间歇性地调用 `GetQueueStatistics` API。它不用于提供队列统计信息的实时跟踪。


## Related topics

- [配置匹配队列](https://docs.xbox.com/zh-CN/services/playfab/multiplayer/matchmaking/config-queues.md)
- [匹配](https://docs.xbox.com/zh-CN/services/playfab/multiplayer/matchmaking/index.md)
- [获取队列统计信息](https://docs.xbox.com/zh-CN/services/playfab/api-references/rest/multiplayer/matchmaking/get-queue-statistics.md)
- [使用玩家统计信息](https://docs.xbox.com/zh-CN/services/playfab/community/leaderboards/tournaments-leaderboards/using-player-statistics.md)
- [游戏管理的统计信息与排行榜（目录）](https://docs.xbox.com/zh-CN/services/xbox-services/player-data/stats-leaderboards/title-managed/live-statslb-tm-nav.md)
