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

# 排行榜计量

> 了解 PlayFab 排行榜可计费计量的工作方式、它们所记录的操作以及排行榜活动如何计入服务费用。

排行榜计量分为三类。

## 排行榜读取

无论是否基于排名统计信息，排行榜读取都取决于 API 响应中排行榜的大小。如果一个请求返回 N 个条目，则该计量累加 N/10 次（向上取整）。请注意，*N* 受请求参数和排行榜大小影响；此外，若 N \< 10，该计量将累加一次。

以下是会累加此计量的 API 列表：

| API 名称                        | API 参考                                                                                                                                                                                                          |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| GetFriendLeaderboardForEntity | [/rest/api/services/playfab/progression/leaderboards/get-friend-leaderboard-for-entity](https://learn.microsoft.com/en-us/rest/api/services/playfab/progression/leaderboards/get-friend-leaderboard-for-entity) |
| GetLeaderboard                | [/rest/api/services/playfab/progression/leaderboards/get-leaderboard](https://learn.microsoft.com/en-us/rest/api/services/playfab/progression/leaderboards/get-leaderboard)                                     |
| GetLeaderboardAroundEntity    | [/rest/api/services/playfab/progression/leaderboards/get-leaderboard-around-entity](https://learn.microsoft.com/en-us/rest/api/services/playfab/progression/leaderboards/get-leaderboard-around-entity)         |
| GetLeaderboardForEntities     | [/rest/api/services/playfab/progression/leaderboards/get-leaderboard-for-entities](https://learn.microsoft.com/en-us/rest/api/services/playfab/progression/leaderboards/get-leaderboard-for-entities)           |

## 排行榜写入

对独立排行榜（例如不基于排名统计信息的那些排行榜）中的 N 个条目发起更新请求时，排行榜计量累加 N 次。对于基于排名统计信息的排行榜，统计写入和排行榜写入计量都会受到影响。有关详细信息，请参阅"统计写入"。

以下是会累加此计量的 API 列表：

| API 名称                   | API 参考                                                                                                                                                                                            |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| UpdateLeaderboardEntries | [/rest/api/services/playfab/progression/leaderboards/update-leaderboard-entries](https://learn.microsoft.com/en-us/rest/api/services/playfab/progression/leaderboards/update-leaderboard-entries) |

## 排行榜存储

此计量跟踪服务中存储了多少排行榜数据。

对于每个排行榜条目，其消耗的存储量按以下各项之和计算：

* 分数：分数列表长度乘以 `sizeof(long)`。
* 元数据：字段长度。
* 时间戳：`sizeof(long)`。
* 实体 ID 长度。

## 参见

* [statistics-meters.md](/services/playfab/pricing/meters/statistics-meters)。
