Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remaining relevant vm fields added #87

Merged
merged 4 commits into from
Aug 29, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 65 additions & 5 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,11 @@
Mem uint64
CPU float64
MaxMem uint64
BalloonInfo BalloonInfo
MaxDisk uint64
DiskRead uint64
Nics map[string]Nic
BlockStat map[string]BlockStat
QMPStatus string `json:"qmpstatus,omitempty"`
RunningMachine string `json:"running-machine,omitempty"`
RunningQemu string `json:"running-qemu,omitempty"`
Expand All @@ -234,6 +237,53 @@
HA HA `json:",omitempty"`
}

type Nic struct {
MattBGP marked this conversation as resolved.
Show resolved Hide resolved
NetOut uint64
NetIn uint64
}

type BalloonInfo struct {
TotalMem uint64 `json:"total_mem"`
MemSwappedIn uint64 `json:"mem_swapped_in"`
LastUpdate uint64 `json:"last_update"`
MinorPageFaults uint64 `json:"minor_page_faults"`
MajorPageFaults uint64 `json:"major_page_faults"`
MemSwappedOut uint64 `json:"mem_swapped_out"`
FreeMem uint64 `json:"free_mem"`
Actual uint64 `json:"actual"`
MaxMem uint64 `json:"max_mem"`
}

type BlockStat struct {
WrOperations uint64 `json:"wr_operations"`
InvalidUnmapOperations uint64 `json:"invalid_unmap_operations"`
RdOperations uint64 `json:"rd_operations"`
UnmapOperations uint64 `json:"unmap_operations"`
FailedUnmapOperations uint64 `json:"failed_unmap_operations"`
FailedWrOperations uint64 `json:"failed_wr_operations"`
AccountFailed bool `json:"account_failed"`
FailedRdOperations uint64 `json:"failed_rd_operations"`
RdBytes uint64 `json:"rd_bytes"`
WrBytes uint64 `json:"wr_bytes"`
RdTotalTimeNs uint64 `json:"rd_total_time_ns"`
WrTotalTimeNs uint64 `json:"wr_total_time_ns"`
FlushTotalTimeNs uint64 `json:"flush_total_time_ns"`
WrHighestOffset uint64 `json:"wr_highest_offset"`
InvalidRdOperations uint64 `json:"invalid_rd_operations"`
FlushOperations uint64 `json:"flush_operations"`
RdMerged uint64 `json:"rd_merged"`
WrMerged uint64 `json:"wr_merged"`
UnmapBytes uint64 `json:"unmap_bytes"`
InvalidFlushOperations uint64 `json:"invalid_flush_operations"`
TimedStats []any `json:"timed_stats"`
UnmapMerged uint64 `json:"unmap_merged"`
IdleTimeNs uint64 `json:"idle_time_ns"`
AccountInvalid bool `json:"account_invalid"`
UnmapTotalTimeNs uint64 `json:"unmap_total_time_ns"`
FailedFlushOperations uint64 `json:"failed_flush_operations"`
InvalidWrOperations uint64 `json:"invalid_wr_operations"`
}

type HA struct {
Managed int
}
Expand Down Expand Up @@ -290,11 +340,21 @@
)

type RRDData struct {
MaxCPU int
MaxMem uint64
Disk int
MaxDisk uint64
Time uint64
Maxcpu uint64 `json:"maxcpu"`
Cpu float64 `json:"cpu"`

Check failure on line 344 in types.go

View workflow job for this annotation

GitHub Actions / ci

var-naming: struct field Cpu should be CPU (revive)
MattBGP marked this conversation as resolved.
Show resolved Hide resolved
Disk uint64 `json:"disk"`
Netin float64 `json:"netin"`
Netout float64 `json:"netout"`
Maxmem uint64 `json:"maxmem"`
Mem float64 `json:"mem"`
Diskread float64 `json:"diskread"`
Maxdisk uint64 `json:"maxdisk"`
Diskwrite float64 `json:"diskwrite"`
Time int64 `json:"time"`
}

func (r RRDData) Timestamp() time.Time {
return time.Unix(r.Time, 0)
}

// VirtualMachineOptions A key/value pair used to modify a virtual machine config
Expand Down
Loading