Documentation ¶
Index ¶
- Constants
- Variables
- type ForecastDAO
- func (p *ForecastDAO) Connect() (*mgo.Database, error)
- func (p *ForecastDAO) Delete(forecast types.Forecast) error
- func (p *ForecastDAO) DeleteAllBeforeDate(timestamp time.Time) error
- func (p *ForecastDAO) FindAll() ([]types.Forecast, error)
- func (p *ForecastDAO) FindByID(id string) (types.Forecast, error)
- func (p *ForecastDAO) FindOneByTimeWindow(startTime time.Time, endTime time.Time) (types.Forecast, error)
- func (p *ForecastDAO) Insert(forecast types.Forecast) error
- func (p *ForecastDAO) Update(id bson.ObjectId, forecast types.Forecast) error
- type PerformanceProfileDAO
- func (p *PerformanceProfileDAO) Connect() (*mgo.Database, error)
- func (p *PerformanceProfileDAO) Delete(performanceProfile types.PerformanceProfile) error
- func (p *PerformanceProfileDAO) DeleteAll() error
- func (p *PerformanceProfileDAO) FindAll() ([]types.PerformanceProfile, error)
- func (p *PerformanceProfileDAO) FindAllUnderLimits(cores float64, memory float64) ([]types.PerformanceProfile, error)
- func (p *PerformanceProfileDAO) FindByID(id string) (types.PerformanceProfile, error)
- func (p *PerformanceProfileDAO) FindByLimitsAndReplicas(cores float64, memory float64, replicas int) (types.PerformanceProfile, error)
- func (p *PerformanceProfileDAO) FindProfileByLimits(limit types.Limit) (types.PerformanceProfile, error)
- func (p *PerformanceProfileDAO) Insert(performanceProfile types.PerformanceProfile) error
- func (p *PerformanceProfileDAO) MatchProfileFitLimitsOver(cores float64, memory float64, requests float64) ([]types.ContainersConfig, error)
- func (p *PerformanceProfileDAO) MatchProfileFitLimitsUnder(cores float64, memory float64, requests float64) ([]types.ContainersConfig, error)
- func (p *PerformanceProfileDAO) UpdateById(id bson.ObjectId, performanceProfile types.PerformanceProfile) error
- type PolicyDAO
- func (p *PolicyDAO) Connect() (*mgo.Database, error)
- func (p *PolicyDAO) DeleteAllByTimeWindow(startTime time.Time, endTime time.Time) error
- func (p *PolicyDAO) DeleteById(id string) error
- func (p *PolicyDAO) FindAll() ([]types.Policy, error)
- func (p *PolicyDAO) FindAllByTimeWindow(startTime time.Time, endTime time.Time) ([]types.Policy, error)
- func (p *PolicyDAO) FindByEndTime(time time.Time) ([]types.Policy, error)
- func (p *PolicyDAO) FindByID(id string) (types.Policy, error)
- func (p *PolicyDAO) FindByStartTime(time time.Time) ([]types.Policy, error)
- func (p *PolicyDAO) FindOneByTimeWindow(startTime time.Time, endTime time.Time) (types.Policy, error)
- func (p *PolicyDAO) FindSelectedByTimeWindow(startTime time.Time, endTime time.Time) (types.Policy, error)
- func (p *PolicyDAO) Insert(policies types.Policy) error
- func (p *PolicyDAO) UpdateById(id bson.ObjectId, policy types.Policy) error
- type VMBootingProfileDAO
- func (p *VMBootingProfileDAO) BootingShutdownTime(vmType string, numInstances int) (types.BootShutDownTime, error)
- func (p *VMBootingProfileDAO) Connect() (*mgo.Database, error)
- func (p *VMBootingProfileDAO) DeleteAll() error
- func (p *VMBootingProfileDAO) FindAll() ([]types.InstancesBootShutdownTime, error)
- func (p *VMBootingProfileDAO) FindByType(vmType string) (types.InstancesBootShutdownTime, error)
- func (p *VMBootingProfileDAO) Insert(vmBootingProfile types.InstancesBootShutdownTime) error
- func (p *VMBootingProfileDAO) InstanceVMBootingShutdown(vmType string) (types.InstancesBootShutdownTime, error)
- func (p *VMBootingProfileDAO) UpdateByType(vmType string, vmBootingProfile types.InstancesBootShutdownTime) error
Constants ¶
const ( DEFAULT_DB_FORECAST = "Forecast" DEFAULT_DB_COLLECTION_FORECAST = "Forecast" )
const ( DEFAULT_DB_POLICIES = "Policies" DEFAULT_DB_COLLECTION_POLICIES = "Policies" )
const ( DEFAULT_DB_PROFILES = "ServiceProfiles" DEFAULT_DB_COLLECTION_PROFILES = "PerformanceProfiles" )
const (
DEFAULT_DB_COLLECTION_VM_PROFILES = "VM_Booting_Profile"
)
Variables ¶
var DEFAULT_DB_SERVER_PROFILES = os.Getenv("PROFILESDB_HOST")
var DEFAULT_DB_SERVER_VM_BOOTING = os.Getenv("PROFILESDB_HOST")
Functions ¶
This section is empty.
Types ¶
type ForecastDAO ¶
type ForecastDAO struct { Server string Database string Collection string // contains filtered or unexported fields }
var ( ForecastDB *ForecastDAO DEFAULT_DB_SERVER_FORECAST = os.Getenv("FORECASTDB_HOST") )
func GetForecastDAO ¶
func GetForecastDAO(serviceName string) *ForecastDAO
func (*ForecastDAO) Connect ¶
func (p *ForecastDAO) Connect() (*mgo.Database, error)
Connect to the database
func (*ForecastDAO) Delete ¶
func (p *ForecastDAO) Delete(forecast types.Forecast) error
Delete the specified item
func (*ForecastDAO) DeleteAllBeforeDate ¶
func (p *ForecastDAO) DeleteAllBeforeDate(timestamp time.Time) error
Delete all forecast older than a timestamp
func (*ForecastDAO) FindAll ¶
func (p *ForecastDAO) FindAll() ([]types.Forecast, error)
Retrieve all the stored elements
func (*ForecastDAO) FindByID ¶
func (p *ForecastDAO) FindByID(id string) (types.Forecast, error)
Retrieve the item with the specified ID
func (*ForecastDAO) FindOneByTimeWindow ¶
func (p *ForecastDAO) FindOneByTimeWindow(startTime time.Time, endTime time.Time) (types.Forecast, error)
Retrieve all policies for start time greater than or equal to time t
type PerformanceProfileDAO ¶
type PerformanceProfileDAO struct { Server string Database string Collection string Session *mgo.Session // contains filtered or unexported fields }
var PerformanceProfileDB *PerformanceProfileDAO
func GetPerformanceProfileDAO ¶
func GetPerformanceProfileDAO(serviceName string) *PerformanceProfileDAO
func (*PerformanceProfileDAO) Connect ¶
func (p *PerformanceProfileDAO) Connect() (*mgo.Database, error)
Connect to the database
func (*PerformanceProfileDAO) Delete ¶
func (p *PerformanceProfileDAO) Delete(performanceProfile types.PerformanceProfile) error
Delete the specified item
func (*PerformanceProfileDAO) DeleteAll ¶
func (p *PerformanceProfileDAO) DeleteAll() error
Delete the specified item
func (*PerformanceProfileDAO) FindAll ¶
func (p *PerformanceProfileDAO) FindAll() ([]types.PerformanceProfile, error)
Retrieve all the stored elements
func (*PerformanceProfileDAO) FindAllUnderLimits ¶
func (p *PerformanceProfileDAO) FindAllUnderLimits(cores float64, memory float64) ([]types.PerformanceProfile, error)
Bring limits for which are profiles available in:
@cores float64 @memory float64
out:
@ContainersConfig []types.ContainersConfig @error
func (*PerformanceProfileDAO) FindByID ¶
func (p *PerformanceProfileDAO) FindByID(id string) (types.PerformanceProfile, error)
Retrieve the item with the specified ID
func (*PerformanceProfileDAO) FindByLimitsAndReplicas ¶
func (p *PerformanceProfileDAO) FindByLimitsAndReplicas(cores float64, memory float64, replicas int) (types.PerformanceProfile, error)
func (*PerformanceProfileDAO) FindProfileByLimits ¶
func (p *PerformanceProfileDAO) FindProfileByLimits(limit types.Limit) (types.PerformanceProfile, error)
func (*PerformanceProfileDAO) Insert ¶
func (p *PerformanceProfileDAO) Insert(performanceProfile types.PerformanceProfile) error
Insert a new Performance Profile
func (*PerformanceProfileDAO) MatchProfileFitLimitsOver ¶
func (p *PerformanceProfileDAO) MatchProfileFitLimitsOver(cores float64, memory float64, requests float64) ([]types.ContainersConfig, error)
Matches the profiles which fit into the specified limits and that provide a MSCPerSecond greater or equal than than the number of requests needed in:
@requests float64
out:
@ContainersConfig []types.ContainersConfig @error
func (*PerformanceProfileDAO) MatchProfileFitLimitsUnder ¶
func (p *PerformanceProfileDAO) MatchProfileFitLimitsUnder(cores float64, memory float64, requests float64) ([]types.ContainersConfig, error)
Matches the profiles which fit into the specified limits and that provide a MSCPerSecond less than than the number of requests needed in:
@requests float64
out:
@ContainersConfig []types.ContainersConfig @error
func (*PerformanceProfileDAO) UpdateById ¶
func (p *PerformanceProfileDAO) UpdateById(id bson.ObjectId, performanceProfile types.PerformanceProfile) error
Update by id
type PolicyDAO ¶
type PolicyDAO struct { Server string Database string Collection string // contains filtered or unexported fields }
func GetPolicyDAO ¶
func (*PolicyDAO) DeleteAllByTimeWindow ¶
Delete all policies for the time window
func (*PolicyDAO) FindAllByTimeWindow ¶
func (p *PolicyDAO) FindAllByTimeWindow(startTime time.Time, endTime time.Time) ([]types.Policy, error)
Retrieve all policies for start time greater than or equal to time t
func (*PolicyDAO) FindByEndTime ¶
Retrieve all policies for start time less than or equal to time t
func (*PolicyDAO) FindByStartTime ¶
Retrieve all policies for start time greater than or equal to time t
func (*PolicyDAO) FindOneByTimeWindow ¶
func (p *PolicyDAO) FindOneByTimeWindow(startTime time.Time, endTime time.Time) (types.Policy, error)
Retrieve all policies for start time greater than or equal to time t
func (*PolicyDAO) FindSelectedByTimeWindow ¶
func (p *PolicyDAO) FindSelectedByTimeWindow(startTime time.Time, endTime time.Time) (types.Policy, error)
Retrieve the policy selected for the given time window
type VMBootingProfileDAO ¶
type VMBootingProfileDAO struct { Server string Database string Collection string Session *mgo.Session // contains filtered or unexported fields }
var VMBootingProfileDB *VMBootingProfileDAO
func GetVMBootingProfileDAO ¶
func GetVMBootingProfileDAO() *VMBootingProfileDAO
func (*VMBootingProfileDAO) BootingShutdownTime ¶
func (p *VMBootingProfileDAO) BootingShutdownTime(vmType string, numInstances int) (types.BootShutDownTime, error)
Search booting and shutdown time for a vm type and number of instances
func (*VMBootingProfileDAO) Connect ¶
func (p *VMBootingProfileDAO) Connect() (*mgo.Database, error)
Connect to the database
func (*VMBootingProfileDAO) DeleteAll ¶
func (p *VMBootingProfileDAO) DeleteAll() error
Delete the specified item
func (*VMBootingProfileDAO) FindAll ¶
func (p *VMBootingProfileDAO) FindAll() ([]types.InstancesBootShutdownTime, error)
Retrieve all the stored elements
func (*VMBootingProfileDAO) FindByType ¶
func (p *VMBootingProfileDAO) FindByType(vmType string) (types.InstancesBootShutdownTime, error)
Retrieve the item with the specified ID
func (*VMBootingProfileDAO) Insert ¶
func (p *VMBootingProfileDAO) Insert(vmBootingProfile types.InstancesBootShutdownTime) error
Insert a new Performance Profile
func (*VMBootingProfileDAO) InstanceVMBootingShutdown ¶
func (p *VMBootingProfileDAO) InstanceVMBootingShutdown(vmType string) (types.InstancesBootShutdownTime, error)
Search booting and shutdown time for a vm type
func (*VMBootingProfileDAO) UpdateByType ¶
func (p *VMBootingProfileDAO) UpdateByType(vmType string, vmBootingProfile types.InstancesBootShutdownTime) error
Update by type