Documentation ¶
Index ¶
- func Statistics(ctx *cputil.Context, req *Req) ([][]any, error)
- type DiskIoReq
- type DiskIoResp
- type DiskIoRespList
- type KvmInfoReq
- type KvmInfoResp
- type KvmInfoRespList
- type NetAdapterNetworkReq
- type NetAdapterNetworkResp
- type NetAdapterReq
- type NetAdapterResp
- type NetAdapterRespList
- type NetAdapterUsageReq
- type NetAdapterUsageResp
- type NetDetailReq
- type NetDetailResp
- type NetTotalReq
- type NetTotalResp
- type Req
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DiskIoReq ¶
type DiskIoReq struct { Id uint // cloud id Dev string // vda vdd StartTime int64 // 开始毫秒时间戳(1699344000000) UTC+8 EndTime int64 // 结束毫秒时间戳(1699344060000) UTC+8 }
DiskIoReq 硬盘IO
type DiskIoResp ¶
type DiskIoResp struct {
List []DiskIoRespList `json:"list"`
}
type DiskIoRespList ¶
type KvmInfoReq ¶
type KvmInfoReq struct { Id uint // cloud id StartTime int64 // 开始毫秒时间戳(1699344000000) UTC+8 EndTime int64 // 结束毫秒时间戳(1699344060000) UTC+8 }
KvmInfoReq CPU+内存使用量
type KvmInfoResp ¶
type KvmInfoResp struct {
List []KvmInfoRespList `json:"list"`
}
func KvmInfo ¶
func KvmInfo(ctx *cputil.Context, req *KvmInfoReq) (*KvmInfoResp, error)
type KvmInfoRespList ¶
type NetAdapterNetworkReq ¶
type NetAdapterNetworkReq struct { Id uint // cloud id NetworkOffset uint8 // 网卡顺序 从0开始 StartTime int64 // 开始毫秒时间戳(1699344000000) UTC+8 EndTime int64 // 结束毫秒时间戳(1699344060000) UTC+8 }
NetAdapterNetworkReq 网卡带宽
type NetAdapterNetworkResp ¶
type NetAdapterNetworkResp struct { List []NetAdapterRespList `json:"list"` // 流量列表 Stat NetDetailResp `json:"stat"` // 汇总数据 }
func NetAdapterNetwork ¶
func NetAdapterNetwork(ctx *cputil.Context, req *NetAdapterNetworkReq) (*NetAdapterNetworkResp, error)
type NetAdapterReq ¶
type NetAdapterReq struct { Id uint // cloud id Kvm string // kvm id NetworkOffset uint8 // 网卡顺序 从0开始 Usage bool // 是否查询用量(流量),默认 查询网卡/带宽 StartTime int64 // 开始毫秒时间戳(1699344000000) UTC+8 EndTime int64 // 结束毫秒时间戳(1699344060000) UTC+8 }
NetAdapterReq 网卡
type NetAdapterResp ¶
type NetAdapterResp struct {
List []NetAdapterRespList `json:"list"`
}
func NetAdapter ¶
func NetAdapter(ctx *cputil.Context, req *NetAdapterReq) (*NetAdapterResp, error)
type NetAdapterRespList ¶
type NetAdapterUsageReq ¶
type NetAdapterUsageReq struct { Id uint // cloud id NetworkOffset uint8 // 网卡顺序 从0开始 StartTime int64 // 开始毫秒时间戳(1699344000000) UTC+8 EndTime int64 // 结束毫秒时间戳(1699344060000) UTC+8 }
NetAdapterUsageReq 用量排行
type NetAdapterUsageResp ¶
type NetAdapterUsageResp struct { List []NetAdapterRespList `json:"list"` // 流量列表 Stat NetTotalResp `json:"stat"` // 汇总数据 }
func NetAdapterUsage ¶
func NetAdapterUsage(ctx *cputil.Context, req *NetAdapterUsageReq) (*NetAdapterUsageResp, error)
type NetDetailReq ¶
type NetDetailReq struct { NodeId uint `url:"node_id,omitempty"` // node_id KvmIfName string `url:"kvm_ifname,omitempty"` // $kvmid.$NetworkOffset StartTime int64 `url:"st,omitempty"` // 开始毫秒时间戳(1699344000000) UTC+8 EndTime int64 `url:"et,omitempty"` // 结束毫秒时间戳(1699344060000) UTC+8 }
NetDetailReq http://~/v1/net_detail?node_id=14&kvm_ifname=kvm1146.0&st=1699432018000&et=1699438740820
func (*NetDetailReq) Body ¶
func (r *NetDetailReq) Body() any
func (*NetDetailReq) Form ¶
func (r *NetDetailReq) Form() (form url.Values)
func (*NetDetailReq) Header ¶
func (r *NetDetailReq) Header() http.Header
func (*NetDetailReq) Method ¶
func (r *NetDetailReq) Method() string
func (*NetDetailReq) Url ¶
func (r *NetDetailReq) Url() string
func (*NetDetailReq) Values ¶
func (r *NetDetailReq) Values() (values url.Values)
type NetDetailResp ¶
type NetDetailResp struct { Accept struct { Total float64 `json:"total"` // 总流量(Byte) Max float64 `json:"max"` // 最大流量(Byte) New float64 `json:"new"` // 最新流量(Byte) Average float64 `json:"average"` // 平均流量(Byte) } `json:"accept"` // 流入流量(Byte) Send struct { Total float64 `json:"total"` // 总流量(Byte) Max float64 `json:"max"` // 最大流量(Byte) New float64 `json:"new"` // 最新流量(Byte) Average float64 `json:"average"` // 平均流量(Byte) } `json:"send"` // 流出流量(Byte) Max struct { Total float64 `json:"total"` Send float64 `json:"send"` Accept float64 `json:"accept"` } `json:"95"` // ignored }
func NetDetail ¶
func NetDetail(ctx *cputil.Context, req *NetDetailReq) (*NetDetailResp, error)
type NetTotalReq ¶
type NetTotalReq struct { NodeId uint `url:"node_id,omitempty"` // node_id KvmIfName string `url:"kvm_ifname,omitempty"` // $kvmid.$NetworkOffset }
NetTotalReq 查询总流量 http://~/v1/net_total?node_id=14&kvm=kvm1146&type=net_adapter&kvm_ifname=kvm1146.0&status=1&st=1699432018000&et=1699439971121
func (*NetTotalReq) Body ¶
func (r *NetTotalReq) Body() any
func (*NetTotalReq) Form ¶
func (r *NetTotalReq) Form() (form url.Values)
func (*NetTotalReq) Header ¶
func (r *NetTotalReq) Header() http.Header
func (*NetTotalReq) Method ¶
func (r *NetTotalReq) Method() string
func (*NetTotalReq) Url ¶
func (r *NetTotalReq) Url() string
func (*NetTotalReq) Values ¶
func (r *NetTotalReq) Values() (values url.Values)
type NetTotalResp ¶
type NetTotalResp struct { Time string `json:"time"` // 时间 Accept int64 `json:"accept"` // 接收流量(Byte) Send int64 `json:"send"` // 发送流量(Byte) }
func NetTotal ¶
func NetTotal(ctx *cputil.Context, req *NetTotalReq) (*NetTotalResp, error)
type Req ¶
type Req struct { Kvm string `url:"kvm,omitempty"` // kvmid Type string `url:"type,omitempty"` // kvm_info StartTime int64 `url:"st,omitempty"` // 开始毫秒时间戳(1699344000000) UTC+8 EndTime int64 `url:"et,omitempty"` // 结束毫秒时间戳(1699344060000) UTC+8 Dev string `url:"dev,omitempty"` // for disk io KvmIfName string `url:"kvm_ifname,omitempty"` // for net adapter Status string `url:"status,omitempty"` // for net adapter }
Req http://~/v1/statistics?node_id=13&kvm=kvm1145&type=kvm_info&st=1699344000000&et=1699344060000
Click to show internal directories.
Click to hide internal directories.