Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
A-Tune
提交
b40ed198
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,发现更多精彩内容 >>
提交
b40ed198
编写于
3月 16, 2020
作者:
L
lixiaoguang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
atune: fix the error that check the fixed port of the rest service
上级
c2b22332
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
14 addition
and
11 deletion
+14
-11
cmd/atuned/atuned.go
cmd/atuned/atuned.go
+1
-1
common/project/projet.go
common/project/projet.go
+0
-1
common/service/monitor/monitors.go
common/service/monitor/monitors.go
+1
-1
common/service/service.go
common/service/service.go
+0
-1
common/service/timer/timer.go
common/service/timer/timer.go
+1
-1
common/tuning/optimizer.go
common/tuning/optimizer.go
+0
-1
common/utils/utils.go
common/utils/utils.go
+11
-5
未找到文件。
cmd/atuned/atuned.go
浏览文件 @
b40ed198
...
...
@@ -187,7 +187,7 @@ func runatuned(ctx *cli.Context) error {
return
err
}
if
err
:=
utils
.
WaitForPyservice
();
err
!=
nil
{
if
err
:=
utils
.
WaitForPyservice
(
config
.
LocalHost
,
config
.
RestPort
);
err
!=
nil
{
log
.
Errorf
(
"waiting for pyservice faild: %v"
,
err
)
return
err
}
...
...
common/project/projet.go
浏览文件 @
b40ed198
...
...
@@ -175,4 +175,3 @@ func ExecCommand(script string) ([]byte, error) {
out
,
err
:=
cmd
.
CombinedOutput
()
return
out
,
err
}
common/service/monitor/monitors.go
浏览文件 @
b40ed198
...
...
@@ -48,7 +48,7 @@ func (m *Monitor) Set(cfg *config.Cfg) {
// Run method start the monitor service
func
(
m
*
Monitor
)
Run
()
error
{
if
err
:=
utils
.
WaitForPyservice
();
err
!=
nil
{
if
err
:=
utils
.
WaitForPyservice
(
config
.
LocalHost
,
config
.
RestPort
);
err
!=
nil
{
log
.
Errorf
(
"waiting for pyservice faild: %v"
,
err
)
return
err
}
...
...
common/service/service.go
浏览文件 @
b40ed198
...
...
@@ -149,4 +149,3 @@ func CheckRpcIsLocalAddr(ctx context.Context) (bool, error) {
}
return
false
,
nil
}
common/service/timer/timer.go
浏览文件 @
b40ed198
...
...
@@ -53,7 +53,7 @@ func (t *Timer) Set(cfg *config.Cfg) {
//Run method start the ticker, auto-tuning the system
func
(
t
*
Timer
)
Run
()
error
{
/* Static & Dynamic judge */
if
err
:=
utils
.
WaitForPyservice
();
err
!=
nil
{
if
err
:=
utils
.
WaitForPyservice
(
config
.
LocalHost
,
config
.
RestPort
);
err
!=
nil
{
log
.
Errorf
(
"waiting for pyservice faild: %v"
,
err
)
return
err
}
...
...
common/tuning/optimizer.go
浏览文件 @
b40ed198
...
...
@@ -301,4 +301,3 @@ func CheckServerPrj(data string, optimizer *Optimizer) error {
return
fmt
.
Errorf
(
"project:%s not found"
,
data
)
}
common/utils/utils.go
浏览文件 @
b40ed198
...
...
@@ -59,6 +59,12 @@ const (
UNKNOWN
=
"UNKNOWN"
)
// config for waiting rest service
const
(
period
=
2
timeout
=
120
)
// CheckArgs method check command args num
func
CheckArgs
(
context
*
cli
.
Context
,
expected
,
checkType
int
)
error
{
var
err
error
...
...
@@ -229,13 +235,14 @@ func RemoveDuplicateElement(message []string) []string {
}
// WaitForPyservice method waiting for pyEngine service start success
func
WaitForPyservice
()
error
{
ticker
:=
time
.
NewTicker
(
time
.
Second
*
2
)
timeout
:=
time
.
After
(
time
.
Second
*
120
)
func
WaitForPyservice
(
address
string
,
port
string
)
error
{
ticker
:=
time
.
NewTicker
(
time
.
Second
*
period
)
timeout
:=
time
.
After
(
time
.
Second
*
timeout
)
addr
:=
address
+
":"
+
port
for
{
select
{
case
<-
ticker
.
C
:
_
,
err
:=
net
.
Dial
(
"tcp"
,
"localhost:8383"
)
_
,
err
:=
net
.
Dial
(
"tcp"
,
addr
)
if
err
!=
nil
{
continue
}
...
...
@@ -354,4 +361,3 @@ func CreateDir(dir string, perm os.FileMode) error {
}
return
nil
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录