Documentation
¶
Index ¶
- Constants
- func CpuIsolatedDevReservedCount() int64
- func HostResidentTenantCount(id string) (map[string]int64, error)
- func HostsResidentTenantStats(hostIDs []string) (map[string]map[string]interface{}, error)
- func MemIsolatedDevReservedSize() int64
- func NewCandidateManager(db DBGroupCacher, sync SyncGroupCacher, stopCh <-chan struct{}) *cache.GroupManager
- func StorageIsolatedDevReservedSize() int64
- type BaremetalBuilder
- type BaremetalDesc
- func (bd *BaremetalDesc) FreeCPUCount() int64
- func (bd *BaremetalDesc) FreeMemSize() int64
- func (bd *BaremetalDesc) FreeStorageSize() int64
- func (bd *BaremetalDesc) Get(key string) interface{}
- func (b *BaremetalDesc) GetAggregates() []*models.Aggregate
- func (h *BaremetalDesc) GetEnableStatus() string
- func (b *BaremetalDesc) GetHostAggregates() []*models.Aggregate
- func (h *BaremetalDesc) GetHostType() string
- func (bd *BaremetalDesc) IndexKey() string
- func (bd *BaremetalDesc) String() string
- func (bd *BaremetalDesc) Type() int
- func (bd *BaremetalDesc) XGet(key string, kind core.Kind) interface{}
- type BuildActor
- type DBGroupCacher
- type DescBuilder
- type GroupCount
- type GroupCounts
- type HostBuilder
- type HostDesc
- func (h *HostDesc) Get(key string) interface{}
- func (b *HostDesc) GetAggregates() []*models.Aggregate
- func (h *HostDesc) GetEnableStatus() string
- func (h *HostDesc) GetFreeCPUCount(useRsvd bool) int64
- func (h *HostDesc) GetFreeLocalStorageSize(useRsvd bool) int64
- func (h *HostDesc) GetFreeMemSize(useRsvd bool) int64
- func (h *HostDesc) GetFreeStorageSizeOfType(sType string, useRsvd bool) int64
- func (b *HostDesc) GetHostAggregates() []*models.Aggregate
- func (h *HostDesc) GetHostType() string
- func (h *HostDesc) GetIsolatedDevice(devID string) *IsolatedDeviceDesc
- func (h *HostDesc) GetReservedCPUCount() int64
- func (h *HostDesc) GetReservedMemSize() int64
- func (h *HostDesc) GetReservedStorageSize() int64
- func (h *HostDesc) GetTotalCPUCount(useRsvd bool) int64
- func (h *HostDesc) GetTotalLocalStorageSize(useRsvd bool) int64
- func (h *HostDesc) GetTotalMemSize(useRsvd bool) int64
- func (h *HostDesc) GuestReservedCPUCountFree() int64
- func (h *HostDesc) GuestReservedMemSizeFree() int64
- func (h *HostDesc) GuestReservedStorageSizeFree() int64
- func (h *HostDesc) IndexKey() string
- func (h *HostDesc) String() string
- func (h *HostDesc) Type() int
- func (h *HostDesc) UnusedGpuDevices() []*IsolatedDeviceDesc
- func (h *HostDesc) UnusedIsolatedDevices() []*IsolatedDeviceDesc
- func (h *HostDesc) UnusedIsolatedDevicesByModel(model string) []*IsolatedDeviceDesc
- func (h *HostDesc) UnusedIsolatedDevicesByType(devType string) []*IsolatedDeviceDesc
- func (h *HostDesc) UnusedIsolatedDevicesByVendorModel(vendorModel string) []*IsolatedDeviceDesc
- func (h *HostDesc) XGet(key string, kind core.Kind) interface{}
- type HostGroupCountDict
- type IsolatedDeviceDesc
- type ReservedResource
- type Storage
- type SyncGroupCacher
- type WaitGroupWrapper
Constants ¶
View Source
const ( CacheKind = "CandidateCache" HostCandidateCache = "Hosts" BaremetalCandidateCache = "Baremetals" HostDescBuilder = HostCandidateCache BaremetalDescBuilder = BaremetalCandidateCache )
Variables ¶
This section is empty.
Functions ¶
func CpuIsolatedDevReservedCount ¶
func CpuIsolatedDevReservedCount() int64
func MemIsolatedDevReservedSize ¶
func MemIsolatedDevReservedSize() int64
func NewCandidateManager ¶
func NewCandidateManager(db DBGroupCacher, sync SyncGroupCacher, stopCh <-chan struct{}) *cache.GroupManager
func StorageIsolatedDevReservedSize ¶
func StorageIsolatedDevReservedSize() int64
Types ¶
type BaremetalBuilder ¶
type BaremetalBuilder struct {
// contains filtered or unexported fields
}
func (*BaremetalBuilder) AllIDs ¶
func (bb *BaremetalBuilder) AllIDs() ([]string, error)
func (*BaremetalBuilder) Clone ¶
func (bb *BaremetalBuilder) Clone() BuildActor
func (*BaremetalBuilder) Do ¶
func (bb *BaremetalBuilder) Do(ids []string, dbCache DBGroupCacher, syncCache SyncGroupCacher) ([]interface{}, error)
func (*BaremetalBuilder) Type ¶
func (bb *BaremetalBuilder) Type() string
type BaremetalDesc ¶
type BaremetalDesc struct {
Storages []*api.BaremetalStorage `json:"storages"`
StorageType string `json:"storage_type"`
StorageSize int64 `json:"storage_size"`
StorageInfo string `json:"storage_info"`
StorageDriver string `json:"storage_driver"`
ServerID string `json:"server_id"`
// contains filtered or unexported fields
}
func (*BaremetalDesc) FreeCPUCount ¶
func (bd *BaremetalDesc) FreeCPUCount() int64
func (*BaremetalDesc) FreeMemSize ¶
func (bd *BaremetalDesc) FreeMemSize() int64
func (*BaremetalDesc) FreeStorageSize ¶
func (bd *BaremetalDesc) FreeStorageSize() int64
func (*BaremetalDesc) Get ¶
func (bd *BaremetalDesc) Get(key string) interface{}
func (*BaremetalDesc) GetAggregates ¶
func (*BaremetalDesc) GetEnableStatus ¶
func (h *BaremetalDesc) GetEnableStatus() string
func (*BaremetalDesc) GetHostAggregates ¶
func (*BaremetalDesc) GetHostType ¶
func (h *BaremetalDesc) GetHostType() string
func (*BaremetalDesc) IndexKey ¶
func (bd *BaremetalDesc) IndexKey() string
func (*BaremetalDesc) String ¶
func (bd *BaremetalDesc) String() string
func (*BaremetalDesc) Type ¶
func (bd *BaremetalDesc) Type() int
type BuildActor ¶
type BuildActor interface {
Clone() BuildActor
Type() string
AllIDs() ([]string, error)
Do(ids []string, db DBGroupCacher, sync SyncGroupCacher) ([]interface{}, error)
}
type DBGroupCacher ¶
type DBGroupCacher interface {
// contains filtered or unexported methods
}
type DescBuilder ¶
type DescBuilder struct {
// contains filtered or unexported fields
}
func NewDescBuilder ¶
func NewDescBuilder(db DBGroupCacher, sync SyncGroupCacher, act BuildActor) *DescBuilder
func (*DescBuilder) Build ¶
func (d *DescBuilder) Build(ids []string) ([]interface{}, error)
type GroupCount ¶
type GroupCounts ¶
type GroupCounts struct {
Data map[string]*GroupCount `json:"data"` // group_id: group_count
}
func NewGroupCounts ¶
func NewGroupCounts() *GroupCounts
type HostBuilder ¶
type HostBuilder struct {
// contains filtered or unexported fields
}
func (*HostBuilder) AllIDs ¶
func (b *HostBuilder) AllIDs() ([]string, error)
func (*HostBuilder) Clone ¶
func (b *HostBuilder) Clone() BuildActor
func (*HostBuilder) Do ¶
func (b *HostBuilder) Do(ids []string, dbCache DBGroupCacher, syncCache SyncGroupCacher) ([]interface{}, error)
func (*HostBuilder) Type ¶
func (b *HostBuilder) Type() string
type HostDesc ¶
type HostDesc struct {
// cpu
CPUMHZ int64 `json:"cpu_mhz"`
CPUCmtbound float64 `json:"cpu_cmtbound"`
CPUDesc string `json:"cpu_desc"`
CPUCache int64 `json:"cpu_cache"`
CPUReserved int64 `json:"cpu_reserved"`
CPUBoundCount int64 `json:"cpu_bound_count"`
CPULoad *float64 `json:"cpu_load"`
TotalCPUCount int64 `json:"total_cpu_count"`
RunningCPUCount int64 `json:"running_cpu_count"`
CreatingCPUCount int64 `json:"creating_cpu_count"`
RequiredCPUCount int64 `json:"required_cpu_count"`
FakeDeletedCPUCount int64 `json:"fake_deleted_cpu_count"`
FreeCPUCount int64 `json:"free_cpu_count"`
// memory
MemCmtbound float64 `json:"mem_cmtbound"`
MemReserved int64 `json:"mem_reserved"`
TotalMemSize int64 `json:"total_mem_size"`
FreeMemSize int64 `json:"free_mem_size"`
RunningMemSize int64 `json:"running_mem_size"`
CreatingMemSize int64 `json:"creating_mem_size"`
RequiredMemSize int64 `json:"required_mem_size"`
FakeDeletedMemSize int64 `json:"fake_deleted_mem_size"`
// storage
Storages []*Storage `json:"storages"`
// IO
IOBoundCount int64 `json:"io_bound_count"`
IOLoad *float64 `json:"io_load"`
// server
GuestCount int64 `json:"guest_count"`
CreatingGuestCount int64 `json:"creating_guest_count"`
RunningGuestCount int64 `json:"running_guest_count"`
Groups *GroupCounts `json:"groups"`
Metadata map[string]string `json:"metadata"`
IsolatedDevices []*IsolatedDeviceDesc `json:"isolated_devices"`
ManagerID *string `json:"manager_id"`
IsMaintenance bool `json:"is_maintenance"`
GuestReservedResource *ReservedResource `json:"guest_reserved_resource"`
GuestReservedResourceUsed *ReservedResource `json:"guest_reserved_used"`
// contains filtered or unexported fields
}
func (*HostDesc) GetAggregates ¶
func (*HostDesc) GetEnableStatus ¶
func (h *HostDesc) GetEnableStatus() string
func (*HostDesc) GetFreeCPUCount ¶
func (*HostDesc) GetFreeLocalStorageSize ¶
func (*HostDesc) GetFreeMemSize ¶
func (*HostDesc) GetFreeStorageSizeOfType ¶
func (*HostDesc) GetHostAggregates ¶
func (*HostDesc) GetHostType ¶
func (h *HostDesc) GetHostType() string
func (*HostDesc) GetIsolatedDevice ¶
func (h *HostDesc) GetIsolatedDevice(devID string) *IsolatedDeviceDesc
func (*HostDesc) GetReservedCPUCount ¶
func (*HostDesc) GetReservedMemSize ¶
func (*HostDesc) GetReservedStorageSize ¶
func (*HostDesc) GetTotalCPUCount ¶
func (*HostDesc) GetTotalLocalStorageSize ¶
func (*HostDesc) GetTotalMemSize ¶
func (*HostDesc) GuestReservedCPUCountFree ¶
func (*HostDesc) GuestReservedMemSizeFree ¶
func (*HostDesc) GuestReservedStorageSizeFree ¶
func (*HostDesc) UnusedGpuDevices ¶
func (h *HostDesc) UnusedGpuDevices() []*IsolatedDeviceDesc
func (*HostDesc) UnusedIsolatedDevices ¶
func (h *HostDesc) UnusedIsolatedDevices() []*IsolatedDeviceDesc
func (*HostDesc) UnusedIsolatedDevicesByModel ¶
func (h *HostDesc) UnusedIsolatedDevicesByModel(model string) []*IsolatedDeviceDesc
func (*HostDesc) UnusedIsolatedDevicesByType ¶
func (h *HostDesc) UnusedIsolatedDevicesByType(devType string) []*IsolatedDeviceDesc
func (*HostDesc) UnusedIsolatedDevicesByVendorModel ¶
func (h *HostDesc) UnusedIsolatedDevicesByVendorModel(vendorModel string) []*IsolatedDeviceDesc
type HostGroupCountDict ¶
type HostGroupCountDict map[string]*GroupCounts
type IsolatedDeviceDesc ¶
type IsolatedDeviceDesc struct {
ID string
GuestID string
HostID string
DevType string
Model string
Addr string
VendorDeviceID string
}
func (*IsolatedDeviceDesc) VendorID ¶
func (i *IsolatedDeviceDesc) VendorID() string
func (*IsolatedDeviceDesc) VendorModel ¶
func (i *IsolatedDeviceDesc) VendorModel() string
type ReservedResource ¶
type ReservedResource struct {
CPUCount int64 `json:"cpu_count"`
MemorySize int64 `json:"memory_size"`
StorageSize int64 `json:"storage_size"`
}
func NewGuestReservedResourceByBuilder ¶
func NewGuestReservedResourceByBuilder(b *HostBuilder, host *models.Host) (ret *ReservedResource)
func NewGuestReservedResourceUsedByBuilder ¶
func NewGuestReservedResourceUsedByBuilder(b *HostBuilder, host *models.Host) (ret *ReservedResource, err error)
func NewReservedResource ¶
func NewReservedResource(cpu, mem, storage int64) *ReservedResource
type Storage ¶
type Storage struct {
ID string `json:"id"`
Name string `json:"name"`
Capacity int64 `json:"capacity"`
StorageType string `json:"type"`
UsedCapacity int64 `json:"used"`
WasteCapacity int64 `json:"waste"`
FreeCapacity int64 `json:"free"`
VCapacity int64 `json:"vcapacity"`
Cmtbound float64 `json:"cmtbound"`
StorageDriver string `json:"driver"`
Adapter string `json:"adapter"`
Splits []string `json:"splits"`
Range string `json:"range"`
Conf string `json:"conf"`
MinStripSize int `json:"min_strip_size"`
MaxStripSize int `json:"max_strip_size"`
Size int `json:"size"`
}
func (*Storage) GetFreeSize ¶
func (*Storage) GetTotalSize ¶
type SyncGroupCacher ¶
type SyncGroupCacher interface {
// contains filtered or unexported methods
}
type WaitGroupWrapper ¶
func (*WaitGroupWrapper) Wrap ¶
func (w *WaitGroupWrapper) Wrap(cb func())
Click to show internal directories.
Click to hide internal directories.