Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
A-Tune
提交
52cf0b1e
A
A-Tune
项目概览
openeuler
/
A-Tune
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
A-Tune
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
52cf0b1e
编写于
4月 02, 2020
作者:
H
hanxinke
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
atune: update output and log
上级
a914615f
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
67 addition
and
67 deletion
+67
-67
cmd/atuned/atuned.go
cmd/atuned/atuned.go
+4
-4
common/config/config.go
common/config/config.go
+1
-1
common/log/log.go
common/log/log.go
+1
-1
common/models/configurator.go
common/models/configurator.go
+3
-3
common/models/monitor.go
common/models/monitor.go
+3
-3
common/models/training.go
common/models/training.go
+1
-1
common/profile/loader.go
common/profile/loader.go
+1
-1
common/profile/profile.go
common/profile/profile.go
+4
-4
common/profile/profile_rollback.go
common/profile/profile_rollback.go
+2
-2
common/project/projet.go
common/project/projet.go
+6
-6
common/schedule/schedule.go
common/schedule/schedule.go
+4
-4
common/service/monitor/monitors.go
common/service/monitor/monitors.go
+2
-2
common/service/pyservice/pyservice.go
common/service/pyservice/pyservice.go
+2
-2
common/service/timer/timer.go
common/service/timer/timer.go
+1
-1
common/sqlstore/sqlstore.go
common/sqlstore/sqlstore.go
+3
-3
common/tuning/hpre_tuning.go
common/tuning/hpre_tuning.go
+3
-3
common/tuning/optimizer.go
common/tuning/optimizer.go
+3
-3
common/tuning/rule_tuning.go
common/tuning/rule_tuning.go
+1
-1
modules/client/profile/profile_define.go
modules/client/profile/profile_define.go
+1
-1
modules/server/profile/profile.go
modules/server/profile/profile.go
+18
-18
tests/test_atund_cnf_disk.sh
tests/test_atund_cnf_disk.sh
+1
-1
tests/test_atund_cnf_network.sh
tests/test_atund_cnf_network.sh
+1
-1
tests/test_atund_cnf_user.sh
tests/test_atund_cnf_user.sh
+1
-1
未找到文件。
cmd/atuned/atuned.go
浏览文件 @
52cf0b1e
...
@@ -105,7 +105,7 @@ func doBeforeJob(ctx *cli.Context) error {
...
@@ -105,7 +105,7 @@ func doBeforeJob(ctx *cli.Context) error {
cfg
:=
config
.
NewCfg
()
cfg
:=
config
.
NewCfg
()
if
err
:=
cfg
.
Load
();
err
!=
nil
{
if
err
:=
cfg
.
Load
();
err
!=
nil
{
log
.
Errorf
(
"Faild to load config file, error: %v"
,
err
)
log
.
Errorf
(
"Faild to load config file, error: %v"
,
err
)
return
fmt
.
Errorf
(
"faild to load config file, error: %v"
,
err
)
return
fmt
.
Errorf
(
"fail
e
d to load config file, error: %v"
,
err
)
}
}
store
:=
&
sqlstore
.
Sqlstore
{
store
:=
&
sqlstore
.
Sqlstore
{
...
@@ -123,7 +123,7 @@ func doBeforeJob(ctx *cli.Context) error {
...
@@ -123,7 +123,7 @@ func doBeforeJob(ctx *cli.Context) error {
log
.
Infof
(
"initializing service: %s"
,
service
.
Name
)
log
.
Infof
(
"initializing service: %s"
,
service
.
Name
)
service
.
Instance
.
Set
(
cfg
)
service
.
Instance
.
Set
(
cfg
)
if
err
:=
service
.
Instance
.
Init
();
err
!=
nil
{
if
err
:=
service
.
Instance
.
Init
();
err
!=
nil
{
return
fmt
.
Errorf
(
"service init faild: %v"
,
err
)
return
fmt
.
Errorf
(
"service init fail
e
d: %v"
,
err
)
}
}
}
}
...
@@ -138,7 +138,7 @@ func doBeforeJob(ctx *cli.Context) error {
...
@@ -138,7 +138,7 @@ func doBeforeJob(ctx *cli.Context) error {
go
func
()
{
go
func
()
{
err
:=
backgroundService
.
Run
()
err
:=
backgroundService
.
Run
()
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Errorf
(
"service %s running faild, reason: %v"
,
service
.
Name
,
err
)
log
.
Errorf
(
"service %s running fail
e
d, reason: %v"
,
service
.
Name
,
err
)
return
return
}
}
}()
}()
...
@@ -188,7 +188,7 @@ func runatuned(ctx *cli.Context) error {
...
@@ -188,7 +188,7 @@ func runatuned(ctx *cli.Context) error {
}
}
if
err
:=
utils
.
WaitForPyservice
(
config
.
LocalHost
,
config
.
RestPort
);
err
!=
nil
{
if
err
:=
utils
.
WaitForPyservice
(
config
.
LocalHost
,
config
.
RestPort
);
err
!=
nil
{
log
.
Errorf
(
"waiting for pyservice faild: %v"
,
err
)
log
.
Errorf
(
"waiting for pyservice fail
e
d: %v"
,
err
)
return
err
return
err
}
}
...
...
common/config/config.go
浏览文件 @
52cf0b1e
...
@@ -128,7 +128,7 @@ func (c *Cfg) Load() error {
...
@@ -128,7 +128,7 @@ func (c *Cfg) Load() error {
cfg
,
err
:=
ini
.
Load
(
defaultConfigFile
)
cfg
,
err
:=
ini
.
Load
(
defaultConfigFile
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"faild to parse %s, %v"
,
defaultConfigFile
,
err
)
return
fmt
.
Errorf
(
"fail
e
d to parse %s, %v"
,
defaultConfigFile
,
err
)
}
}
c
.
Raw
=
cfg
c
.
Raw
=
cfg
...
...
common/log/log.go
浏览文件 @
52cf0b1e
...
@@ -49,7 +49,7 @@ func InitLogger(modes []string, cfg *ini.File) error {
...
@@ -49,7 +49,7 @@ func InitLogger(modes []string, cfg *ini.File) error {
case
"syslog"
:
case
"syslog"
:
syslogHook
,
err
:=
logrus_syslog
.
NewSyslogHook
(
""
,
""
,
syslog
.
LOG_INFO
,
"atuned"
)
syslogHook
,
err
:=
logrus_syslog
.
NewSyslogHook
(
""
,
""
,
syslog
.
LOG_INFO
,
"atuned"
)
if
err
!=
nil
{
if
err
!=
nil
{
baseLogger
.
Errorf
(
"syslog hook init faild:%v"
,
err
)
baseLogger
.
Errorf
(
"syslog hook init fail
e
d:%v"
,
err
)
}
}
baseLogger
.
entry
.
Logger
.
AddHook
(
syslogHook
)
baseLogger
.
entry
.
Logger
.
AddHook
(
syslogHook
)
}
}
...
...
common/models/configurator.go
浏览文件 @
52cf0b1e
...
@@ -48,7 +48,7 @@ func (c *Configurator) Put() (*RespConfigurator, error) {
...
@@ -48,7 +48,7 @@ func (c *Configurator) Put() (*RespConfigurator, error) {
return
nil
,
fmt
.
Errorf
(
"section %s is not exist"
,
c
.
Section
)
return
nil
,
fmt
.
Errorf
(
"section %s is not exist"
,
c
.
Section
)
}
}
if
res
.
StatusCode
!=
200
{
if
res
.
StatusCode
!=
200
{
return
nil
,
fmt
.
Errorf
(
"connect to configurator service faild"
)
return
nil
,
fmt
.
Errorf
(
"connect to configurator service fail
e
d"
)
}
}
resBody
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
resBody
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -77,7 +77,7 @@ func (c *Configurator) Post() (*RespConfigurator, error) {
...
@@ -77,7 +77,7 @@ func (c *Configurator) Post() (*RespConfigurator, error) {
return
nil
,
fmt
.
Errorf
(
"section %s is not exist"
,
c
.
Section
)
return
nil
,
fmt
.
Errorf
(
"section %s is not exist"
,
c
.
Section
)
}
}
if
res
.
StatusCode
!=
200
{
if
res
.
StatusCode
!=
200
{
return
nil
,
fmt
.
Errorf
(
"connect to configurator service faild"
)
return
nil
,
fmt
.
Errorf
(
"connect to configurator service fail
e
d"
)
}
}
resBody
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
resBody
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -106,7 +106,7 @@ func (c *Configurator) Get() (*RespConfigurator, error) {
...
@@ -106,7 +106,7 @@ func (c *Configurator) Get() (*RespConfigurator, error) {
return
nil
,
fmt
.
Errorf
(
"section %s is not exist"
,
c
.
Section
)
return
nil
,
fmt
.
Errorf
(
"section %s is not exist"
,
c
.
Section
)
}
}
if
res
.
StatusCode
!=
200
{
if
res
.
StatusCode
!=
200
{
return
nil
,
fmt
.
Errorf
(
"connect to configurator service faild"
)
return
nil
,
fmt
.
Errorf
(
"connect to configurator service fail
e
d"
)
}
}
resBody
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
resBody
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
...
...
common/models/monitor.go
浏览文件 @
52cf0b1e
...
@@ -48,7 +48,7 @@ func (m *MonitorBody) Get() (*MonitorGetResp, error) {
...
@@ -48,7 +48,7 @@ func (m *MonitorBody) Get() (*MonitorGetResp, error) {
defer
res
.
Body
.
Close
()
defer
res
.
Body
.
Close
()
if
res
.
StatusCode
!=
200
{
if
res
.
StatusCode
!=
200
{
return
nil
,
fmt
.
Errorf
(
"connect to monitor service faild"
)
return
nil
,
fmt
.
Errorf
(
"connect to monitor service fail
e
d"
)
}
}
resBody
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
resBody
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
...
@@ -77,12 +77,12 @@ func MonitorGet(module string, purpose string, format string, path string, para
...
@@ -77,12 +77,12 @@ func MonitorGet(module string, purpose string, format string, path string, para
respGetIns
,
err
:=
monitorBody
.
Get
()
respGetIns
,
err
:=
monitorBody
.
Get
()
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Errorf
(
"model monitor module %s get data faild: %v"
,
module
,
err
)
log
.
Errorf
(
"model monitor module %s get data fail
e
d: %v"
,
module
,
err
)
return
""
,
err
return
""
,
err
}
}
if
respGetIns
.
Status
!=
"OK"
{
if
respGetIns
.
Status
!=
"OK"
{
log
.
Errorf
(
"model monitor module %s get data faild, error: %s"
,
module
,
respGetIns
.
Value
)
log
.
Errorf
(
"model monitor module %s get data fail
e
d, error: %s"
,
module
,
respGetIns
.
Value
)
return
""
,
fmt
.
Errorf
(
respGetIns
.
Value
)
return
""
,
fmt
.
Errorf
(
respGetIns
.
Value
)
}
}
return
respGetIns
.
Value
,
nil
return
respGetIns
.
Value
,
nil
...
...
common/models/training.go
浏览文件 @
52cf0b1e
...
@@ -36,7 +36,7 @@ func (t *Training) Post() (bool, error) {
...
@@ -36,7 +36,7 @@ func (t *Training) Post() (bool, error) {
defer
response
.
Body
.
Close
()
defer
response
.
Body
.
Close
()
if
response
.
StatusCode
!=
200
{
if
response
.
StatusCode
!=
200
{
return
false
,
fmt
.
Errorf
(
"training data faild"
)
return
false
,
fmt
.
Errorf
(
"training data fail
e
d"
)
}
}
return
true
,
nil
return
true
,
nil
...
...
common/profile/loader.go
浏览文件 @
52cf0b1e
...
@@ -165,7 +165,7 @@ func LoadFromWorkloadType(workloadType string) (Profile, bool) {
...
@@ -165,7 +165,7 @@ func LoadFromWorkloadType(workloadType string) (Profile, bool) {
classProfile
:=
&
sqlstore
.
GetClass
{
Class
:
workloadType
}
classProfile
:=
&
sqlstore
.
GetClass
{
Class
:
workloadType
}
err
:=
sqlstore
.
GetClasses
(
classProfile
)
err
:=
sqlstore
.
GetClasses
(
classProfile
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Errorf
(
"inquery class_profile table faild"
)
log
.
Errorf
(
"inquery class_profile table fail
e
d"
)
return
Profile
{},
false
return
Profile
{},
false
}
}
if
len
(
classProfile
.
Result
)
==
0
{
if
len
(
classProfile
.
Result
)
==
0
{
...
...
common/profile/profile.go
浏览文件 @
52cf0b1e
...
@@ -76,7 +76,7 @@ func (c *ConfigPutBody) Put() (*RespPut, error) {
...
@@ -76,7 +76,7 @@ func (c *ConfigPutBody) Put() (*RespPut, error) {
}
}
defer
res
.
Body
.
Close
()
defer
res
.
Body
.
Close
()
if
res
.
StatusCode
!=
200
{
if
res
.
StatusCode
!=
200
{
return
nil
,
fmt
.
Errorf
(
"connect to configurator service faild"
)
return
nil
,
fmt
.
Errorf
(
"connect to configurator service fail
e
d"
)
}
}
resBody
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
resBody
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -101,7 +101,7 @@ func (c *ConfigPutBody) Post() (*RespPut, error) {
...
@@ -101,7 +101,7 @@ func (c *ConfigPutBody) Post() (*RespPut, error) {
}
}
defer
res
.
Body
.
Close
()
defer
res
.
Body
.
Close
()
if
res
.
StatusCode
!=
200
{
if
res
.
StatusCode
!=
200
{
return
nil
,
fmt
.
Errorf
(
"connect to configurator service faild"
)
return
nil
,
fmt
.
Errorf
(
"connect to configurator service fail
e
d"
)
}
}
resBody
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
resBody
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -347,7 +347,7 @@ func (p *Profile) Check(ch chan *PB.AckCheck) error {
...
@@ -347,7 +347,7 @@ func (p *Profile) Check(ch chan *PB.AckCheck) error {
for
_
,
service
:=
range
services
{
for
_
,
service
:=
range
services
{
log
.
Infof
(
"initializing checker service in profile check: %s"
,
service
.
Name
)
log
.
Infof
(
"initializing checker service in profile check: %s"
,
service
.
Name
)
if
err
:=
service
.
Instance
.
Init
();
err
!=
nil
{
if
err
:=
service
.
Instance
.
Init
();
err
!=
nil
{
return
fmt
.
Errorf
(
"service init faild: %v"
,
err
)
return
fmt
.
Errorf
(
"service init fail
e
d: %v"
,
err
)
}
}
}
}
...
@@ -364,7 +364,7 @@ func (p *Profile) Check(ch chan *PB.AckCheck) error {
...
@@ -364,7 +364,7 @@ func (p *Profile) Check(ch chan *PB.AckCheck) error {
}
}
err
:=
checkerService
.
Check
(
ch
)
err
:=
checkerService
.
Check
(
ch
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Errorf
(
"service %s running faild, reason: %v"
,
service
.
Name
,
err
)
log
.
Errorf
(
"service %s running fail
e
d, reason: %v"
,
service
.
Name
,
err
)
continue
continue
}
}
}
}
...
...
common/profile/profile_rollback.go
浏览文件 @
52cf0b1e
...
@@ -57,7 +57,7 @@ func (p *HistoryProfile) Resume(ch chan *PB.AckCheck) error {
...
@@ -57,7 +57,7 @@ func (p *HistoryProfile) Resume(ch chan *PB.AckCheck) error {
description
:=
fmt
.
Sprintf
(
"value: %s"
,
key
.
Value
())
description
:=
fmt
.
Sprintf
(
"value: %s"
,
key
.
Value
())
sendChanToAdm
(
ch
,
key
.
Name
(),
utils
.
SUCCESS
,
description
)
sendChanToAdm
(
ch
,
key
.
Name
(),
utils
.
SUCCESS
,
description
)
}
else
{
}
else
{
description
:=
fmt
.
Sprintf
(
"faild: %s"
,
statusStr
)
description
:=
fmt
.
Sprintf
(
"fail
e
d: %s"
,
statusStr
)
sendChanToAdm
(
ch
,
key
.
Name
(),
utils
.
FAILD
,
description
)
sendChanToAdm
(
ch
,
key
.
Name
(),
utils
.
FAILD
,
description
)
}
}
}
}
...
@@ -80,7 +80,7 @@ func (p *HistoryProfile) Load(context string) error {
...
@@ -80,7 +80,7 @@ func (p *HistoryProfile) Load(context string) error {
func
Rollback
()
error
{
func
Rollback
()
error
{
profileLogs
,
err
:=
sqlstore
.
GetProfileLogs
()
profileLogs
,
err
:=
sqlstore
.
GetProfileLogs
()
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Errorf
(
"get profile history faild, %v"
,
err
)
log
.
Errorf
(
"get profile history fail
e
d, %v"
,
err
)
return
err
return
err
}
}
...
...
common/project/projet.go
浏览文件 @
52cf0b1e
...
@@ -87,13 +87,13 @@ func (y *YamlPrjCli) BenchMark() (string, error) {
...
@@ -87,13 +87,13 @@ func (y *YamlPrjCli) BenchMark() (string, error) {
newScript
:=
strings
.
Replace
(
evaluation
.
Info
.
Get
,
"$out"
,
string
(
benchOutByte
),
-
1
)
newScript
:=
strings
.
Replace
(
evaluation
.
Info
.
Get
,
"$out"
,
string
(
benchOutByte
),
-
1
)
bout
,
err
:=
ExecCommand
(
newScript
)
bout
,
err
:=
ExecCommand
(
newScript
)
if
err
!=
nil
{
if
err
!=
nil
{
err
=
fmt
.
Errorf
(
"faild to exec %s, err: %v"
,
newScript
,
err
)
err
=
fmt
.
Errorf
(
"fail
e
d to exec %s, err: %v"
,
newScript
,
err
)
return
strings
.
Join
(
benchStr
,
","
),
err
return
strings
.
Join
(
benchStr
,
","
),
err
}
}
floatOut
,
err
:=
strconv
.
ParseFloat
(
strings
.
Replace
(
string
(
bout
),
"
\n
"
,
""
,
-
1
),
64
)
floatOut
,
err
:=
strconv
.
ParseFloat
(
strings
.
Replace
(
string
(
bout
),
"
\n
"
,
""
,
-
1
),
64
)
if
err
!=
nil
{
if
err
!=
nil
{
err
=
fmt
.
Errorf
(
"faild to parse float, err: %v"
,
err
)
err
=
fmt
.
Errorf
(
"fail
e
d to parse float, err: %v"
,
err
)
return
strings
.
Join
(
benchStr
,
","
),
err
return
strings
.
Join
(
benchStr
,
","
),
err
}
}
...
@@ -121,7 +121,7 @@ func (y *YamlPrjSvr) RunSet(optStr string) error {
...
@@ -121,7 +121,7 @@ func (y *YamlPrjSvr) RunSet(optStr string) error {
for
_
,
obj
:=
range
y
.
Object
{
for
_
,
obj
:=
range
y
.
Object
{
out
,
err
:=
ExecCommand
(
obj
.
Info
.
GetScript
)
out
,
err
:=
ExecCommand
(
obj
.
Info
.
GetScript
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"faild to exec %s, err: %v"
,
obj
.
Info
.
GetScript
,
err
)
return
fmt
.
Errorf
(
"fail
e
d to exec %s, err: %v"
,
obj
.
Info
.
GetScript
,
err
)
}
}
if
strings
.
TrimSpace
(
string
(
out
))
==
paraMap
[
obj
.
Name
]
{
if
strings
.
TrimSpace
(
string
(
out
))
==
paraMap
[
obj
.
Name
]
{
...
@@ -133,7 +133,7 @@ func (y *YamlPrjSvr) RunSet(optStr string) error {
...
@@ -133,7 +133,7 @@ func (y *YamlPrjSvr) RunSet(optStr string) error {
log
.
Info
(
"set script:"
,
newScript
)
log
.
Info
(
"set script:"
,
newScript
)
_
,
err
=
ExecCommand
(
newScript
)
_
,
err
=
ExecCommand
(
newScript
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"faild to exec %s, err: %v"
,
newScript
,
err
)
return
fmt
.
Errorf
(
"fail
e
d to exec %s, err: %v"
,
newScript
,
err
)
}
}
}
}
return
nil
return
nil
...
@@ -155,13 +155,13 @@ func (y *YamlPrjSvr) RestartProject() error {
...
@@ -155,13 +155,13 @@ func (y *YamlPrjSvr) RestartProject() error {
if
needRestart
{
if
needRestart
{
out
,
err
:=
ExecCommand
(
stopWorkload
)
out
,
err
:=
ExecCommand
(
stopWorkload
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"faild to exec %s, err: %v"
,
stopWorkload
,
err
)
return
fmt
.
Errorf
(
"fail
e
d to exec %s, err: %v"
,
stopWorkload
,
err
)
}
}
log
.
Debug
(
string
(
out
))
log
.
Debug
(
string
(
out
))
out
,
err
=
ExecCommand
(
startWorkload
)
out
,
err
=
ExecCommand
(
startWorkload
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"faild to exec %s, err: %v"
,
startWorkload
,
err
)
return
fmt
.
Errorf
(
"fail
e
d to exec %s, err: %v"
,
startWorkload
,
err
)
}
}
log
.
Debug
(
string
(
out
))
log
.
Debug
(
string
(
out
))
}
}
...
...
common/schedule/schedule.go
浏览文件 @
52cf0b1e
...
@@ -60,7 +60,7 @@ func (c *ConfigPutBody) Put() (*RespPut, error) {
...
@@ -60,7 +60,7 @@ func (c *ConfigPutBody) Put() (*RespPut, error) {
}
}
defer
res
.
Body
.
Close
()
defer
res
.
Body
.
Close
()
if
res
.
StatusCode
!=
200
{
if
res
.
StatusCode
!=
200
{
return
nil
,
fmt
.
Errorf
(
"connect to configurator service faild"
)
return
nil
,
fmt
.
Errorf
(
"connect to configurator service fail
e
d"
)
}
}
resBody
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
resBody
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -85,7 +85,7 @@ func (c *ConfigPutBody) Get() (*RespPut, error) {
...
@@ -85,7 +85,7 @@ func (c *ConfigPutBody) Get() (*RespPut, error) {
}
}
defer
res
.
Body
.
Close
()
defer
res
.
Body
.
Close
()
if
res
.
StatusCode
!=
200
{
if
res
.
StatusCode
!=
200
{
return
nil
,
fmt
.
Errorf
(
"connect to configurator service faild"
)
return
nil
,
fmt
.
Errorf
(
"connect to configurator service fail
e
d"
)
}
}
resBody
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
resBody
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -182,7 +182,7 @@ func (s *Scheduler) Active(ch chan *PB.AckCheck, itemKeys []string, items map[st
...
@@ -182,7 +182,7 @@ func (s *Scheduler) Active(ch chan *PB.AckCheck, itemKeys []string, items map[st
for
_
,
service
:=
range
services
{
for
_
,
service
:=
range
services
{
log
.
Infof
(
"initializing checker service: %s"
,
service
.
Name
)
log
.
Infof
(
"initializing checker service: %s"
,
service
.
Name
)
if
err
:=
service
.
Instance
.
Init
();
err
!=
nil
{
if
err
:=
service
.
Instance
.
Init
();
err
!=
nil
{
return
fmt
.
Errorf
(
"service init faild: %v"
,
err
)
return
fmt
.
Errorf
(
"service init fail
e
d: %v"
,
err
)
}
}
}
}
...
@@ -199,7 +199,7 @@ func (s *Scheduler) Active(ch chan *PB.AckCheck, itemKeys []string, items map[st
...
@@ -199,7 +199,7 @@ func (s *Scheduler) Active(ch chan *PB.AckCheck, itemKeys []string, items map[st
}
}
err
:=
checkerService
.
Check
(
ch
)
err
:=
checkerService
.
Check
(
ch
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Errorf
(
"service %s running faild, reason: %v"
,
service
.
Name
,
err
)
log
.
Errorf
(
"service %s running fail
e
d, reason: %v"
,
service
.
Name
,
err
)
continue
continue
}
}
}
}
...
...
common/service/monitor/monitors.go
浏览文件 @
52cf0b1e
...
@@ -49,7 +49,7 @@ func (m *Monitor) Set(cfg *config.Cfg) {
...
@@ -49,7 +49,7 @@ func (m *Monitor) Set(cfg *config.Cfg) {
// Run method start the monitor service
// Run method start the monitor service
func
(
m
*
Monitor
)
Run
()
error
{
func
(
m
*
Monitor
)
Run
()
error
{
if
err
:=
utils
.
WaitForPyservice
(
config
.
LocalHost
,
config
.
RestPort
);
err
!=
nil
{
if
err
:=
utils
.
WaitForPyservice
(
config
.
LocalHost
,
config
.
RestPort
);
err
!=
nil
{
log
.
Errorf
(
"waiting for pyservice faild: %v"
,
err
)
log
.
Errorf
(
"waiting for pyservice fail
e
d: %v"
,
err
)
return
err
return
err
}
}
...
@@ -85,7 +85,7 @@ func (m *Monitor) Run() error {
...
@@ -85,7 +85,7 @@ func (m *Monitor) Run() error {
if
_
,
err
:=
models
.
MonitorGet
(
strings
.
ToUpper
(
modulePurpose
[
0
]),
if
_
,
err
:=
models
.
MonitorGet
(
strings
.
ToUpper
(
modulePurpose
[
0
]),
strings
.
ToUpper
(
modulePurpose
[
1
]),
strings
.
ToUpper
(
modulePurpose
[
1
]),
config
.
FileFormat
,
filename
,
""
);
err
!=
nil
{
config
.
FileFormat
,
filename
,
""
);
err
!=
nil
{
log
.
Errorf
(
"collect module %s faild, error: %v"
,
module
,
err
)
log
.
Errorf
(
"collect module %s fail
e
d, error: %v"
,
module
,
err
)
continue
continue
}
}
}
}
...
...
common/service/pyservice/pyservice.go
浏览文件 @
52cf0b1e
...
@@ -66,14 +66,14 @@ func (p *PyEngine) Run() error {
...
@@ -66,14 +66,14 @@ func (p *PyEngine) Run() error {
err
:=
cmd
.
Start
()
err
:=
cmd
.
Start
()
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Errorf
(
"cmd.Start() analysis service faild: %v"
,
err
)
log
.
Errorf
(
"cmd.Start() analysis service fail
e
d: %v"
,
err
)
os
.
Exit
(
-
1
)
os
.
Exit
(
-
1
)
}
}
err
=
cmd
.
Wait
()
err
=
cmd
.
Wait
()
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Errorf
(
"cmd.Run() analysis faild with: %v"
,
err
)
log
.
Errorf
(
"cmd.Run() analysis fail
e
d with: %v"
,
err
)
os
.
Exit
(
-
1
)
os
.
Exit
(
-
1
)
}
}
...
...
common/service/timer/timer.go
浏览文件 @
52cf0b1e
...
@@ -54,7 +54,7 @@ func (t *Timer) Set(cfg *config.Cfg) {
...
@@ -54,7 +54,7 @@ func (t *Timer) Set(cfg *config.Cfg) {
func
(
t
*
Timer
)
Run
()
error
{
func
(
t
*
Timer
)
Run
()
error
{
/* Static & Dynamic judge */
/* Static & Dynamic judge */
if
err
:=
utils
.
WaitForPyservice
(
config
.
LocalHost
,
config
.
RestPort
);
err
!=
nil
{
if
err
:=
utils
.
WaitForPyservice
(
config
.
LocalHost
,
config
.
RestPort
);
err
!=
nil
{
log
.
Errorf
(
"waiting for pyservice faild: %v"
,
err
)
log
.
Errorf
(
"waiting for pyservice fail
e
d: %v"
,
err
)
return
err
return
err
}
}
...
...
common/sqlstore/sqlstore.go
浏览文件 @
52cf0b1e
...
@@ -38,7 +38,7 @@ func (s *Sqlstore) Init() error {
...
@@ -38,7 +38,7 @@ func (s *Sqlstore) Init() error {
err
:=
os
.
MkdirAll
(
config
.
DatabasePath
,
0750
)
err
:=
os
.
MkdirAll
(
config
.
DatabasePath
,
0750
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"faild to mkdir: %s(%v)"
,
config
.
DatabasePath
,
err
)
return
fmt
.
Errorf
(
"fail
e
d to mkdir: %s(%v)"
,
config
.
DatabasePath
,
err
)
}
}
dbName
:=
path
.
Join
(
config
.
DatabasePath
,
config
.
DatabaseName
)
dbName
:=
path
.
Join
(
config
.
DatabasePath
,
config
.
DatabaseName
)
...
@@ -48,7 +48,7 @@ func (s *Sqlstore) Init() error {
...
@@ -48,7 +48,7 @@ func (s *Sqlstore) Init() error {
engine
,
err
=
xorm
.
NewEngine
(
config
.
DatabaseType
,
connStr
)
engine
,
err
=
xorm
.
NewEngine
(
config
.
DatabaseType
,
connStr
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"faild to connect to database: %v"
,
err
)
return
fmt
.
Errorf
(
"fail
e
d to connect to database: %v"
,
err
)
}
}
s
.
engine
=
engine
s
.
engine
=
engine
...
@@ -68,7 +68,7 @@ func Reload(path string) error {
...
@@ -68,7 +68,7 @@ func Reload(path string) error {
log
.
Infof
(
"Reload DB: %s"
,
path
)
log
.
Infof
(
"Reload DB: %s"
,
path
)
engine
,
err
:=
xorm
.
NewEngine
(
"sqlite3"
,
connStr
)
engine
,
err
:=
xorm
.
NewEngine
(
"sqlite3"
,
connStr
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"faild to connect to database: %v"
,
err
)
return
fmt
.
Errorf
(
"fail
e
d to connect to database: %v"
,
err
)
}
}
globalEngine
=
engine
globalEngine
=
engine
...
...
common/tuning/hpre_tuning.go
浏览文件 @
52cf0b1e
...
@@ -57,7 +57,7 @@ func (h *HprePostBody) Get() (*RespHprePost, error) {
...
@@ -57,7 +57,7 @@ func (h *HprePostBody) Get() (*RespHprePost, error) {
fmt
.
Println
(
res
.
StatusCode
)
fmt
.
Println
(
res
.
StatusCode
)
respBody
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
respBody
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
fmt
.
Println
(
string
(
respBody
),
err
)
fmt
.
Println
(
string
(
respBody
),
err
)
return
nil
,
fmt
.
Errorf
(
"get hpre support faild"
)
return
nil
,
fmt
.
Errorf
(
"get hpre support fail
e
d"
)
}
}
respBody
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
respBody
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
...
@@ -125,8 +125,8 @@ func IsSupportHpre() (bool, error) {
...
@@ -125,8 +125,8 @@ func IsSupportHpre() (bool, error) {
}
}
respGetIns
,
err
:=
body
.
Get
()
respGetIns
,
err
:=
body
.
Get
()
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Infof
(
"get support_hpre faild"
)
log
.
Infof
(
"get support_hpre fail
e
d"
)
return
false
,
fmt
.
Errorf
(
"get support_hpre faild"
)
return
false
,
fmt
.
Errorf
(
"get support_hpre fail
e
d"
)
}
}
if
respGetIns
.
Value
==
"yes"
{
if
respGetIns
.
Value
==
"yes"
{
...
...
common/tuning/optimizer.go
浏览文件 @
52cf0b1e
...
@@ -93,7 +93,7 @@ func (o *Optimizer) InitTuned(ch chan *PB.AckCheck) error {
...
@@ -93,7 +93,7 @@ func (o *Optimizer) InitTuned(ch chan *PB.AckCheck) error {
out
,
err
:=
project
.
ExecCommand
(
item
.
Info
.
GetScript
)
out
,
err
:=
project
.
ExecCommand
(
item
.
Info
.
GetScript
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"faild to exec %s, err: %v"
,
item
.
Info
.
GetScript
,
err
)
return
fmt
.
Errorf
(
"fail
e
d to exec %s, err: %v"
,
item
.
Info
.
GetScript
,
err
)
}
}
initConfigure
=
append
(
initConfigure
,
strings
.
TrimSpace
(
knob
.
Name
+
"="
+
string
(
out
)))
initConfigure
=
append
(
initConfigure
,
strings
.
TrimSpace
(
knob
.
Name
+
"="
+
string
(
out
)))
}
}
...
@@ -265,7 +265,7 @@ func (o *Optimizer) evalParsing(ch chan *PB.AckCheck) (string, error) {
...
@@ -265,7 +265,7 @@ func (o *Optimizer) evalParsing(ch chan *PB.AckCheck) (string, error) {
func
deleteTask
(
url
string
)
error
{
func
deleteTask
(
url
string
)
error
{
resp
,
err
:=
http
.
Delete
(
url
)
resp
,
err
:=
http
.
Delete
(
url
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Error
(
"delete task faild:"
,
err
)
log
.
Error
(
"delete task fail
e
d:"
,
err
)
return
err
return
err
}
}
defer
resp
.
Body
.
Close
()
defer
resp
.
Body
.
Close
()
...
@@ -279,7 +279,7 @@ func CheckServerPrj(data string, optimizer *Optimizer) error {
...
@@ -279,7 +279,7 @@ func CheckServerPrj(data string, optimizer *Optimizer) error {
if
!
info
.
IsDir
()
{
if
!
info
.
IsDir
()
{
prj
:=
new
(
project
.
YamlPrjSvr
)
prj
:=
new
(
project
.
YamlPrjSvr
)
if
err
:=
utils
.
ParseFile
(
path
,
"yaml"
,
&
prj
);
err
!=
nil
{
if
err
:=
utils
.
ParseFile
(
path
,
"yaml"
,
&
prj
);
err
!=
nil
{
return
fmt
.
Errorf
(
"load %s faild, err: %v"
,
path
,
err
)
return
fmt
.
Errorf
(
"load %s fail
e
d, err: %v"
,
path
,
err
)
}
}
log
.
Infof
(
"project:%s load %s success"
,
prj
.
Project
,
path
)
log
.
Infof
(
"project:%s load %s success"
,
prj
.
Project
,
path
)
prjs
=
append
(
prjs
,
prj
)
prjs
=
append
(
prjs
,
prj
)
...
...
common/tuning/rule_tuning.go
浏览文件 @
52cf0b1e
...
@@ -45,7 +45,7 @@ func (r *RuleBody) Post() (*map[string]interface{}, error) {
...
@@ -45,7 +45,7 @@ func (r *RuleBody) Post() (*map[string]interface{}, error) {
defer
res
.
Body
.
Close
()
defer
res
.
Body
.
Close
()
if
res
.
StatusCode
!=
200
{
if
res
.
StatusCode
!=
200
{
log
.
Errorf
(
"URL: %s, response code: %d"
,
url
,
res
.
StatusCode
)
log
.
Errorf
(
"URL: %s, response code: %d"
,
url
,
res
.
StatusCode
)
return
nil
,
fmt
.
Errorf
(
"get monitor data faild, url: %s"
,
url
)
return
nil
,
fmt
.
Errorf
(
"get monitor data fail
e
d, url: %s"
,
url
)
}
}
respBody
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
respBody
,
err
:=
ioutil
.
ReadAll
(
res
.
Body
)
...
...
modules/client/profile/profile_define.go
浏览文件 @
52cf0b1e
...
@@ -78,7 +78,7 @@ func profileDefineCheck(ctx *cli.Context) error {
...
@@ -78,7 +78,7 @@ func profileDefineCheck(ctx *cli.Context) error {
_
,
err
=
ini
.
Load
(
file
)
_
,
err
=
ini
.
Load
(
file
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"load profile faild, file format may be not correct"
)
return
fmt
.
Errorf
(
"load profile fail
e
d, file format may be not correct"
)
}
}
return
nil
return
nil
...
...
modules/server/profile/profile.go
浏览文件 @
52cf0b1e
...
@@ -117,7 +117,7 @@ func NewProfileServer(ctx *cli.Context, opts ...interface{}) (interface{}, error
...
@@ -117,7 +117,7 @@ func NewProfileServer(ctx *cli.Context, opts ...interface{}) (interface{}, error
cfg
,
err
:=
ini
.
Load
(
defaultConfigFile
)
cfg
,
err
:=
ini
.
Load
(
defaultConfigFile
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"faild to parse %s, %v"
,
defaultConfigFile
,
err
)
return
nil
,
fmt
.
Errorf
(
"fail
e
d to parse %s, %v"
,
defaultConfigFile
,
err
)
}
}
return
&
ProfileServer
{
return
&
ProfileServer
{
...
@@ -146,7 +146,7 @@ func (p *ClassifyPostBody) Post() (*RespClassify, error) {
...
@@ -146,7 +146,7 @@ func (p *ClassifyPostBody) Post() (*RespClassify, error) {
defer
response
.
Body
.
Close
()
defer
response
.
Body
.
Close
()
if
response
.
StatusCode
!=
200
{
if
response
.
StatusCode
!=
200
{
return
nil
,
fmt
.
Errorf
(
"online learning faild"
)
return
nil
,
fmt
.
Errorf
(
"online learning fail
e
d"
)
}
}
resBody
,
err
:=
ioutil
.
ReadAll
(
response
.
Body
)
resBody
,
err
:=
ioutil
.
ReadAll
(
response
.
Body
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -172,7 +172,7 @@ func (c *CollectorPost) Post() (*RespCollectorPost, error) {
...
@@ -172,7 +172,7 @@ func (c *CollectorPost) Post() (*RespCollectorPost, error) {
defer
response
.
Body
.
Close
()
defer
response
.
Body
.
Close
()
if
response
.
StatusCode
!=
200
{
if
response
.
StatusCode
!=
200
{
return
nil
,
fmt
.
Errorf
(
"collect data faild"
)
return
nil
,
fmt
.
Errorf
(
"collect data fail
e
d"
)
}
}
resBody
,
err
:=
ioutil
.
ReadAll
(
response
.
Body
)
resBody
,
err
:=
ioutil
.
ReadAll
(
response
.
Body
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -255,7 +255,7 @@ func (s *ProfileServer) CheckInitProfile(profileInfo *PB.ProfileInfo,
...
@@ -255,7 +255,7 @@ func (s *ProfileServer) CheckInitProfile(profileInfo *PB.ProfileInfo,
for
_
,
service
:=
range
services
{
for
_
,
service
:=
range
services
{
log
.
Infof
(
"initializing checker service: %s"
,
service
.
Name
)
log
.
Infof
(
"initializing checker service: %s"
,
service
.
Name
)
if
err
:=
service
.
Instance
.
Init
();
err
!=
nil
{
if
err
:=
service
.
Instance
.
Init
();
err
!=
nil
{
return
fmt
.
Errorf
(
"service init faild: %v"
,
err
)
return
fmt
.
Errorf
(
"service init fail
e
d: %v"
,
err
)
}
}
}
}
...
@@ -272,7 +272,7 @@ func (s *ProfileServer) CheckInitProfile(profileInfo *PB.ProfileInfo,
...
@@ -272,7 +272,7 @@ func (s *ProfileServer) CheckInitProfile(profileInfo *PB.ProfileInfo,
}
}
err
:=
checkerService
.
Check
(
ch
)
err
:=
checkerService
.
Check
(
ch
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Errorf
(
"service %s running faild, reason: %v"
,
service
.
Name
,
err
)
log
.
Errorf
(
"service %s running fail
e
d, reason: %v"
,
service
.
Name
,
err
)
continue
continue
}
}
}
}
...
@@ -291,7 +291,7 @@ func (s *ProfileServer) Analysis(message *PB.AnalysisMessage, stream PB.ProfileM
...
@@ -291,7 +291,7 @@ func (s *ProfileServer) Analysis(message *PB.AnalysisMessage, stream PB.ProfileM
npipe
,
err
:=
utils
.
CreateNamedPipe
()
npipe
,
err
:=
utils
.
CreateNamedPipe
()
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"create named pipe faild"
)
return
fmt
.
Errorf
(
"create named pipe fail
e
d"
)
}
}
defer
os
.
Remove
(
npipe
)
defer
os
.
Remove
(
npipe
)
...
@@ -369,8 +369,8 @@ func (s *ProfileServer) Analysis(message *PB.AnalysisMessage, stream PB.ProfileM
...
@@ -369,8 +369,8 @@ func (s *ProfileServer) Analysis(message *PB.AnalysisMessage, stream PB.ProfileM
//3. judge the workload type is exist in the database
//3. judge the workload type is exist in the database
classProfile
:=
&
sqlstore
.
GetClass
{
Class
:
workloadType
}
classProfile
:=
&
sqlstore
.
GetClass
{
Class
:
workloadType
}
if
err
:=
sqlstore
.
GetClasses
(
classProfile
);
err
!=
nil
{
if
err
:=
sqlstore
.
GetClasses
(
classProfile
);
err
!=
nil
{
log
.
Errorf
(
"inquery workload type table faild %v"
,
err
)
log
.
Errorf
(
"inquery workload type table fail
e
d %v"
,
err
)
return
fmt
.
Errorf
(
"inquery workload type table faild %v"
,
err
)
return
fmt
.
Errorf
(
"inquery workload type table fail
e
d %v"
,
err
)
}
}
if
len
(
classProfile
.
Result
)
==
0
{
if
len
(
classProfile
.
Result
)
==
0
{
log
.
Errorf
(
"%s is not exist in the table"
,
workloadType
)
log
.
Errorf
(
"%s is not exist in the table"
,
workloadType
)
...
@@ -562,8 +562,8 @@ func (s *ProfileServer) InfoProfile(profileInfo *PB.ProfileInfo, stream PB.Profi
...
@@ -562,8 +562,8 @@ func (s *ProfileServer) InfoProfile(profileInfo *PB.ProfileInfo, stream PB.Profi
classProfile
:=
&
sqlstore
.
GetClass
{
Class
:
workloadType
}
classProfile
:=
&
sqlstore
.
GetClass
{
Class
:
workloadType
}
err
:=
sqlstore
.
GetClasses
(
classProfile
)
err
:=
sqlstore
.
GetClasses
(
classProfile
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Errorf
(
"inquery class_profile table faild"
)
log
.
Errorf
(
"inquery class_profile table fail
e
d"
)
return
fmt
.
Errorf
(
"inquery class_profile table faild"
)
return
fmt
.
Errorf
(
"inquery class_profile table fail
e
d"
)
}
}
if
len
(
classProfile
.
Result
)
==
0
{
if
len
(
classProfile
.
Result
)
==
0
{
...
@@ -818,7 +818,7 @@ func (s *ProfileServer) Training(message *PB.TrainMessage, stream PB.ProfileMgr_
...
@@ -818,7 +818,7 @@ func (s *ProfileServer) Training(message *PB.TrainMessage, stream PB.ProfileMgr_
return
nil
return
nil
}
}
_
=
stream
.
Send
(
&
PB
.
AckCheck
{
Name
:
"training the self collect data faild"
})
_
=
stream
.
Send
(
&
PB
.
AckCheck
{
Name
:
"training the self collect data fail
e
d"
})
return
nil
return
nil
}
}
...
@@ -828,7 +828,7 @@ func (s *ProfileServer) Charaterization(profileInfo *PB.ProfileInfo, stream PB.P
...
@@ -828,7 +828,7 @@ func (s *ProfileServer) Charaterization(profileInfo *PB.ProfileInfo, stream PB.P
npipe
,
err
:=
utils
.
CreateNamedPipe
()
npipe
,
err
:=
utils
.
CreateNamedPipe
()
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"create named pipe faild"
)
return
fmt
.
Errorf
(
"create named pipe fail
e
d"
)
}
}
defer
os
.
Remove
(
npipe
)
defer
os
.
Remove
(
npipe
)
...
@@ -989,8 +989,8 @@ func (s *ProfileServer) Delete(ctx context.Context, message *PB.DefineMessage) (
...
@@ -989,8 +989,8 @@ func (s *ProfileServer) Delete(ctx context.Context, message *PB.DefineMessage) (
// get the profile type from the classprofile table
// get the profile type from the classprofile table
classProfile
:=
&
sqlstore
.
GetClass
{
Class
:
workloadType
}
classProfile
:=
&
sqlstore
.
GetClass
{
Class
:
workloadType
}
if
err
:=
sqlstore
.
GetClasses
(
classProfile
);
err
!=
nil
{
if
err
:=
sqlstore
.
GetClasses
(
classProfile
);
err
!=
nil
{
log
.
Errorf
(
"inquery workload type table faild %v"
,
err
)
log
.
Errorf
(
"inquery workload type table fail
e
d %v"
,
err
)
return
&
PB
.
Ack
{},
fmt
.
Errorf
(
"inquery workload type table faild %v"
,
err
)
return
&
PB
.
Ack
{},
fmt
.
Errorf
(
"inquery workload type table fail
e
d %v"
,
err
)
}
}
if
len
(
classProfile
.
Result
)
==
0
{
if
len
(
classProfile
.
Result
)
==
0
{
log
.
Errorf
(
"%s is not exist in the table"
,
workloadType
)
log
.
Errorf
(
"%s is not exist in the table"
,
workloadType
)
...
@@ -1007,13 +1007,13 @@ func (s *ProfileServer) Delete(ctx context.Context, message *PB.DefineMessage) (
...
@@ -1007,13 +1007,13 @@ func (s *ProfileServer) Delete(ctx context.Context, message *PB.DefineMessage) (
// delete profile depend the profiletype
// delete profile depend the profiletype
for
_
,
profileName
:=
range
profileNames
{
for
_
,
profileName
:=
range
profileNames
{
if
err
:=
sqlstore
.
DeleteProfile
(
profileName
);
err
!=
nil
{
if
err
:=
sqlstore
.
DeleteProfile
(
profileName
);
err
!=
nil
{
log
.
Errorf
(
"delete item from profile table faild %v "
,
err
)
log
.
Errorf
(
"delete item from profile table fail
e
d %v "
,
err
)
}
}
}
}
// delete classprofile depend the workloadType
// delete classprofile depend the workloadType
if
err
:=
sqlstore
.
DeleteClassProfile
(
workloadType
);
err
!=
nil
{
if
err
:=
sqlstore
.
DeleteClassProfile
(
workloadType
);
err
!=
nil
{
log
.
Errorf
(
"delete item from classprofile tabble faild."
)
log
.
Errorf
(
"delete item from classprofile tabble fail
e
d."
)
return
&
PB
.
Ack
{},
err
return
&
PB
.
Ack
{},
err
}
}
return
&
PB
.
Ack
{
Status
:
"OK"
},
nil
return
&
PB
.
Ack
{
Status
:
"OK"
},
nil
...
@@ -1044,8 +1044,8 @@ func (s *ProfileServer) Update(ctx context.Context, message *PB.DefineMessage) (
...
@@ -1044,8 +1044,8 @@ func (s *ProfileServer) Update(ctx context.Context, message *PB.DefineMessage) (
// get the profile type from the classprofile table
// get the profile type from the classprofile table
classProfile
:=
&
sqlstore
.
GetClass
{
Class
:
workloadType
}
classProfile
:=
&
sqlstore
.
GetClass
{
Class
:
workloadType
}
if
err
:=
sqlstore
.
GetClasses
(
classProfile
);
err
!=
nil
{
if
err
:=
sqlstore
.
GetClasses
(
classProfile
);
err
!=
nil
{
log
.
Errorf
(
"inquery workload type table faild %v"
,
err
)
log
.
Errorf
(
"inquery workload type table fail
e
d %v"
,
err
)
return
&
PB
.
Ack
{},
fmt
.
Errorf
(
"inquery workload type table faild %v"
,
err
)
return
&
PB
.
Ack
{},
fmt
.
Errorf
(
"inquery workload type table fail
e
d %v"
,
err
)
}
}
if
len
(
classProfile
.
Result
)
==
0
{
if
len
(
classProfile
.
Result
)
==
0
{
log
.
Errorf
(
"%s is not exist in the table"
,
workloadType
)
log
.
Errorf
(
"%s is not exist in the table"
,
workloadType
)
...
...
tests/test_atund_cnf_disk.sh
浏览文件 @
52cf0b1e
...
@@ -55,7 +55,7 @@ test01()
...
@@ -55,7 +55,7 @@ test01()
atune-adm analysis
>
$ANALYSIS_LOG
atune-adm analysis
>
$ANALYSIS_LOG
check_result
$?
1
check_result
$?
1
grep
"collect data faild"
$ANALYSIS_LOG
grep
"collect data fail
e
d"
$ANALYSIS_LOG
check_result
$?
0
check_result
$?
0
done
done
...
...
tests/test_atund_cnf_network.sh
浏览文件 @
52cf0b1e
...
@@ -63,7 +63,7 @@ test01()
...
@@ -63,7 +63,7 @@ test01()
atune-adm analysis
>
$ANALYSIS_LOG
atune-adm analysis
>
$ANALYSIS_LOG
check_result
$?
1
check_result
$?
1
grep
"collect data faild"
$ANALYSIS_LOG
grep
"collect data fail
e
d"
$ANALYSIS_LOG
check_result
$?
0
check_result
$?
0
fi
fi
done
done
...
...
tests/test_atund_cnf_user.sh
浏览文件 @
52cf0b1e
...
@@ -55,7 +55,7 @@ test01()
...
@@ -55,7 +55,7 @@ test01()
atune-adm analysis
>
$ANALYSIS_LOG
atune-adm analysis
>
$ANALYSIS_LOG
check_result
$?
1
check_result
$?
1
grep
"collect data faild"
$ANALYSIS_LOG
grep
"collect data fail
e
d"
$ANALYSIS_LOG
check_result
$?
0
check_result
$?
0
done
done
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录