Files
pyGoEdge-UserPanel/reference/goedge 文档/ServerBandwidthStatService.md
2025-11-18 03:36:49 +08:00

4.4 KiB
Raw Blame History

ServerBandwidthStatService

服务带宽统计服务


findDailyServerBandwidthStats

获取最近N天峰值带宽

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/ServerBandwidthStatService/findDailyServerBandwidthStats
  • RPCrpc findDailyServerBandwidthStats(FindDailyServerBandwidthStatsRequest) returns (FindDailyServerBandwidthStatsResponse);

请求对象 (FindDailyServerBandwidthStatsRequest)

{
  "serverId": "int64 // 服务ID网站ID",
  "days": "int32",
  "algo": "string // 带宽算法目前支持secondly和avg"
}

响应对象 (FindDailyServerBandwidthStatsResponse)

{
  "stats": "[]Stat",
  "percentile": "int32 // 百分位",
  "nthStat": "Stat // 百分位统计数据",
  "day": "string",
  "bytes": "int64 // 峰值字节/秒",
  "bits": "int64 // 峰值比特/秒"
}

调用示例

curl -X POST "https://backend.dooki.cloud/ServerBandwidthStatService/findDailyServerBandwidthStats" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

findDailyServerBandwidthStatsBetweenDays

读取日期段内的带宽数据

  • 角色:admin, user
  • HTTPPOST https://backend.dooki.cloud/ServerBandwidthStatService/findDailyServerBandwidthStatsBetweenDays
  • RPCrpc findDailyServerBandwidthStatsBetweenDays (FindDailyServerBandwidthStatsBetweenDaysRequest) returns (FindDailyServerBandwidthStatsBetweenDaysResponse);

请求对象 (FindDailyServerBandwidthStatsBetweenDaysRequest)

{
  "userId": "int64 // 用户ID和服务ID二选一",
  "serverId": "int64 // 服务ID和用户ID二选一",
  "dayFrom": "string // 开始日期 YYYYMMDD",
  "dayTo": "string // 结束日期 YYYYMMDD",
  "percentile": "int32 // 可选项百分位nth带宽位置0-100之间",
  "nodeRegionId": "int64 // 区域ID可选项目前只有用户整体统计支持区域ID",
  "algo": "string // 带宽算法目前支持secondly和avg"
}

响应对象 (FindDailyServerBandwidthStatsBetweenDaysResponse)

{
  "stats": "[]Stat",
  "nthStat": "Stat",
  "day": "string",
  "timeAt": "string",
  "bytes": "int64 // 峰值字节/秒",
  "bits": "int64 // 峰值比特/秒"
}

调用示例

curl -X POST "https://backend.dooki.cloud/ServerBandwidthStatService/findDailyServerBandwidthStatsBetweenDays" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

findHourlyServerBandwidthStats

获取最近N小时峰值带宽

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/ServerBandwidthStatService/findHourlyServerBandwidthStats
  • RPCrpc findHourlyServerBandwidthStats(FindHourlyServerBandwidthStatsRequest) returns (FindHourlyServerBandwidthStatsResponse);

请求对象 (FindHourlyServerBandwidthStatsRequest)

{
  "serverId": "int64 // 服务ID网站ID",
  "hours": "int32",
  "algo": "string // 带宽算法目前支持secondly和avg"
}

响应对象 (FindHourlyServerBandwidthStatsResponse)

{
  "stats": "[]Stat",
  "percentile": "int32 // 百分位",
  "nthStat": "Stat // 百分位统计数据",
  "day": "string",
  "hour": "int32",
  "bytes": "int64 // 峰值字节/秒",
  "bits": "int64 // 峰值比特/秒"
}

调用示例

curl -X POST "https://backend.dooki.cloud/ServerBandwidthStatService/findHourlyServerBandwidthStats" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

findServerBandwidthStats

获取服务的峰值带宽

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/ServerBandwidthStatService/findServerBandwidthStats
  • RPCrpc findServerBandwidthStats(FindServerBandwidthStatsRequest) returns (FindServerBandwidthStatsResponse);

请求对象 (FindServerBandwidthStatsRequest)

{
  "serverId": "int64 // 服务ID",
  "month": "string // YYYYMMmonth和day二选一",
  "day": "string // YYYYMMDD",
  "algo": "string // 带宽算法目前支持secondly和avg"
}

响应对象 (FindServerBandwidthStatsResponse)

{
  "serverBandwidthStats": "[]ServerBandwidthStat"
}

调用示例

curl -X POST "https://backend.dooki.cloud/ServerBandwidthStatService/findServerBandwidthStats" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'