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

178 lines
4.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ServerBandwidthStatService
> 服务带宽统计服务
---
## findDailyServerBandwidthStats
> 获取最近N天峰值带宽
- 角色:`admin`
- HTTP`POST https://backend.dooki.cloud/ServerBandwidthStatService/findDailyServerBandwidthStats`
- RPC`rpc findDailyServerBandwidthStats(FindDailyServerBandwidthStatsRequest) returns (FindDailyServerBandwidthStatsResponse);`
**请求对象 (`FindDailyServerBandwidthStatsRequest`)**
```json
{
"serverId": "int64 // 服务ID网站ID",
"days": "int32",
"algo": "string // 带宽算法目前支持secondly和avg"
}
```
**响应对象 (`FindDailyServerBandwidthStatsResponse`)**
```json
{
"stats": "[]Stat",
"percentile": "int32 // 百分位",
"nthStat": "Stat // 百分位统计数据",
"day": "string",
"bytes": "int64 // 峰值字节/秒",
"bits": "int64 // 峰值比特/秒"
}
```
**调用示例**
```bash
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`
- HTTP`POST https://backend.dooki.cloud/ServerBandwidthStatService/findDailyServerBandwidthStatsBetweenDays`
- RPC`rpc findDailyServerBandwidthStatsBetweenDays (FindDailyServerBandwidthStatsBetweenDaysRequest) returns (FindDailyServerBandwidthStatsBetweenDaysResponse);`
**请求对象 (`FindDailyServerBandwidthStatsBetweenDaysRequest`)**
```json
{
"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`)**
```json
{
"stats": "[]Stat",
"nthStat": "Stat",
"day": "string",
"timeAt": "string",
"bytes": "int64 // 峰值字节/秒",
"bits": "int64 // 峰值比特/秒"
}
```
**调用示例**
```bash
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`
- HTTP`POST https://backend.dooki.cloud/ServerBandwidthStatService/findHourlyServerBandwidthStats`
- RPC`rpc findHourlyServerBandwidthStats(FindHourlyServerBandwidthStatsRequest) returns (FindHourlyServerBandwidthStatsResponse);`
**请求对象 (`FindHourlyServerBandwidthStatsRequest`)**
```json
{
"serverId": "int64 // 服务ID网站ID",
"hours": "int32",
"algo": "string // 带宽算法目前支持secondly和avg"
}
```
**响应对象 (`FindHourlyServerBandwidthStatsResponse`)**
```json
{
"stats": "[]Stat",
"percentile": "int32 // 百分位",
"nthStat": "Stat // 百分位统计数据",
"day": "string",
"hour": "int32",
"bytes": "int64 // 峰值字节/秒",
"bits": "int64 // 峰值比特/秒"
}
```
**调用示例**
```bash
curl -X POST "https://backend.dooki.cloud/ServerBandwidthStatService/findHourlyServerBandwidthStats" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
```
---
## findServerBandwidthStats
> 获取服务的峰值带宽
- 角色:`admin`
- HTTP`POST https://backend.dooki.cloud/ServerBandwidthStatService/findServerBandwidthStats`
- RPC`rpc findServerBandwidthStats(FindServerBandwidthStatsRequest) returns (FindServerBandwidthStatsResponse);`
**请求对象 (`FindServerBandwidthStatsRequest`)**
```json
{
"serverId": "int64 // 服务ID",
"month": "string // YYYYMMmonth和day二选一",
"day": "string // YYYYMMDD",
"algo": "string // 带宽算法目前支持secondly和avg"
}
```
**响应对象 (`FindServerBandwidthStatsResponse`)**
```json
{
"serverBandwidthStats": "[]ServerBandwidthStat"
}
```
**调用示例**
```bash
curl -X POST "https://backend.dooki.cloud/ServerBandwidthStatService/findServerBandwidthStats" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
```
---