* Copyright (c) 2019 Huawei Technologies Co., Ltd.
* A-Tune is licensed under the Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v2 for more details.
* Create: 2019-10-29
*/
package sqlstore
import (
"errors"
"time"
)
var (
ErrServiceNotFound = errors.New("service not fount")
)
type ClassApps struct {
Class string `xorm:"class"`
Apps string `xorm:"apps"`
ResourceLimit string `xorm:"resource_limit"`
Deletable bool `xorm:"deletable"`
}
type ClassProfile struct {
Class string `xorm:"class"`
ProfileType string `xorm:"profile_type"`
Active bool `xorm:"active"`
}
type Tuned struct {
ID int64 `xorm:"id"`
Class string `xorm:"class"`
Name string `xorm:"name"`
Type string `xorm:"type"`
Value string `xorm:"value"`
Range string `xorm:"range"`
Step int64 `xorm:"step"`
}
type RuleTuned struct {
ID int64 `xorm:"id"`
Name string `xorm:"name"`
Class string `xorm:"class"`
Expression string `xorm:"expression"`
Action string `xorm:"action"`
OppositeAction string `xorm:"opposite_action"`
Monitor string `xorm:"monitor"`
Field string `xorm:"field"`
}
type Collection struct {
ID int64 `xorm:"id"`
Name string `xorm:"name"`
Module string `xorm:"module"`
Purpose string `xorm:"purpose"`
Metrics string `xorm:"metrics"`
}
type ProfileLog struct {
ID int64 `xorm:"id"`
ProfileID string `xorm:"profile_id"`
Context string `xorm:"context"`
BackupPath string `xorm:"backup_path"`
Timestamp time.Time `xorm:"timestamp"`
}
type Schedule struct {
ID int64 `xorm:"id"`
Type string `xorm:"type"`
Strategy string `xorm:"strategy"`
}
type GetClass struct {
Active bool
Class string
Result []*ClassProfile
}
type GetClassApp struct {
Class string
Result []*ClassApps
}
type TunedItem struct {
ID int64 `xorm:"id"`
Property string
Item string
}
type GetTuned struct {
ID int64
Class string
Result []*Tuned
}
type GetRuleTuned struct {
Class string
Result []*RuleTuned
}
type GetProfileLog struct {
ID int64
Result []*ProfileLog
}