Documentation
¶
Index ¶
- Constants
- func GetQosFromReq(req *cubebox.RunCubeSandboxRequest, key string) (*disk.RateLimiter, error)
- func RecordCreateMetric(ctx context.Context, err error, id string, cost time.Duration)
- func RecordCreateMetricIfGreaterThan(ctx context.Context, err error, id string, cost time.Duration, ...)
- func RecordDestroyMetric(ctx context.Context, err error, id string, cost time.Duration)
- func WithCreateContext(ctx context.Context, createContext *CreateContext) context.Context
- type BaseWorkflowInfo
- func (m *BaseWorkflowInfo) AddMetric(err error, id string, t time.Duration)
- func (b *BaseWorkflowInfo) GetAppID() int64
- func (b *BaseWorkflowInfo) GetCPU() int64
- func (b *BaseWorkflowInfo) GetInstanceType() string
- func (b *BaseWorkflowInfo) GetMemory() int64
- func (m *BaseWorkflowInfo) GetMetric() []*Metric
- func (b *BaseWorkflowInfo) GetNumaNode() int32
- func (b *BaseWorkflowInfo) GetPCIMode() string
- func (b *BaseWorkflowInfo) GetSandboxID() string
- func (b *BaseWorkflowInfo) GetSubUin() string
- func (b *BaseWorkflowInfo) GetUin() string
- func (b *BaseWorkflowInfo) IsPCIPFMode() bool
- type CleanContext
- type CreateContext
- func (m *CreateContext) AddMetric(err error, id string, t time.Duration)
- func (b *CreateContext) GetInstanceType() string
- func (m *CreateContext) GetMetric() []*Metric
- func (b *CreateContext) GetQos(key string) (*disk.RateLimiter, error)
- func (b *CreateContext) GetRegion() string
- func (b *CreateContext) GetSnapshotTemplateID() (string, bool)
- func (b *CreateContext) IsCreateSnapshot() bool
- func (b *CreateContext) IsCubeboxV2() bool
- func (b *CreateContext) IsRetoreSnapshot() bool
- type DestroyContext
- type Engine
- func (e *Engine) AddCleaupFlow(f Flow)
- func (e *Engine) AddFlow(k string, f *Workflow)
- func (e *Engine) CleanUp(ctx context.Context, opts *CleanContext) error
- func (e *Engine) Create(ctx context.Context, opts *CreateContext) error
- func (e *Engine) Destroy(ctx context.Context, opts *DestroyContext) error
- func (e *Engine) GetFlowOnFlyingRequests(name string) int64
- func (e *Engine) GetFlowPeakRequests(name string) int64
- func (s *Engine) ID() string
- func (e *Engine) Init(ctx context.Context, opts *InitInfo) error
- func (e *Engine) RegisterMetrics(register *metrictype.CollectRegister) error
- func (e *Engine) SetFlowLimit(name string, limit int64)
- type Flow
- type InitInfo
- type Metric
- type ReqContext
- type Step
- type Workflow
Constants ¶
View Source
const ( KCreateContext contextKey = "kCreateContext" KInitContext contextKey = "KInitContext" KDestroyContext contextKey = "KDestroyContext" )
Variables ¶
This section is empty.
Functions ¶
func GetQosFromReq ¶
func GetQosFromReq(req *cubebox.RunCubeSandboxRequest, key string) (*disk.RateLimiter, error)
func RecordCreateMetric ¶
func RecordDestroyMetric ¶
func WithCreateContext ¶
func WithCreateContext(ctx context.Context, createContext *CreateContext) context.Context
Types ¶
type BaseWorkflowInfo ¶
type BaseWorkflowInfo struct {
SandboxID string
CPU int64
Memory int64
PCIMode string
NumaNode int32
IsRollBack bool
AppID int64
Uin string
SubUin string
// contains filtered or unexported fields
}
func (*BaseWorkflowInfo) GetAppID ¶
func (b *BaseWorkflowInfo) GetAppID() int64
func (*BaseWorkflowInfo) GetCPU ¶
func (b *BaseWorkflowInfo) GetCPU() int64
func (*BaseWorkflowInfo) GetInstanceType ¶
func (b *BaseWorkflowInfo) GetInstanceType() string
func (*BaseWorkflowInfo) GetMemory ¶
func (b *BaseWorkflowInfo) GetMemory() int64
func (*BaseWorkflowInfo) GetNumaNode ¶
func (b *BaseWorkflowInfo) GetNumaNode() int32
func (*BaseWorkflowInfo) GetPCIMode ¶
func (b *BaseWorkflowInfo) GetPCIMode() string
func (*BaseWorkflowInfo) GetSandboxID ¶
func (b *BaseWorkflowInfo) GetSandboxID() string
func (*BaseWorkflowInfo) GetSubUin ¶
func (b *BaseWorkflowInfo) GetSubUin() string
func (*BaseWorkflowInfo) GetUin ¶
func (b *BaseWorkflowInfo) GetUin() string
func (*BaseWorkflowInfo) IsPCIPFMode ¶
func (b *BaseWorkflowInfo) IsPCIPFMode() bool
type CreateContext ¶
type CreateContext struct {
BaseWorkflowInfo
ReqInfo *cubebox.RunCubeSandboxRequest
NetworkInfo provider.NetworkProvider
StorageInfo interface{}
CgroupInfo interface{}
VolumeInfo interface{}
Failover bool
UserData *cubeboxstore.UserData
CubeBoxCreated bool
NetFile *netfile.CubeboxNetfile
LocalRunTemplate *templatetypes.LocalRunTemplate
}
func GetCreateContext ¶
func GetCreateContext(ctx context.Context) *CreateContext
func (*CreateContext) GetInstanceType ¶
func (b *CreateContext) GetInstanceType() string
func (*CreateContext) GetQos ¶
func (b *CreateContext) GetQos(key string) (*disk.RateLimiter, error)
func (*CreateContext) GetRegion ¶
func (b *CreateContext) GetRegion() string
func (*CreateContext) GetSnapshotTemplateID ¶
func (b *CreateContext) GetSnapshotTemplateID() (string, bool)
func (*CreateContext) IsCreateSnapshot ¶
func (b *CreateContext) IsCreateSnapshot() bool
func (*CreateContext) IsCubeboxV2 ¶
func (b *CreateContext) IsCubeboxV2() bool
func (*CreateContext) IsRetoreSnapshot ¶
func (b *CreateContext) IsRetoreSnapshot() bool
type DestroyContext ¶
type DestroyContext struct {
BaseWorkflowInfo
DestroyInfo *cubebox.DestroyCubeSandboxRequest
}
func (*DestroyContext) GetInstanceType ¶
func (b *DestroyContext) GetInstanceType() string
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) AddCleaupFlow ¶
func (*Engine) GetFlowOnFlyingRequests ¶
func (*Engine) GetFlowPeakRequests ¶
func (*Engine) RegisterMetrics ¶
func (e *Engine) RegisterMetrics(register *metrictype.CollectRegister) error
func (*Engine) SetFlowLimit ¶
type InitInfo ¶
type InitInfo struct {
BaseWorkflowInfo
NetCIDR string
MVMInnerIP net.IP
TapInitNum int
}
type ReqContext ¶
type Step ¶
func (*Step) AppendFlow ¶
type Workflow ¶
func (*Workflow) AppendStep ¶
func (*Workflow) GetOnFlyingRequest ¶
func (*Workflow) GetPeakRequest ¶
Click to show internal directories.
Click to hide internal directories.