Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DiDi
nightingale
提交
db0ab163
N
nightingale
项目概览
DiDi
/
nightingale
12 个月 前同步成功
通知
46
Star
7053
Fork
1161
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
nightingale
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
db0ab163
编写于
5月 09, 2020
作者:
C
chenjiandongx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unnessary zero length
上级
c1f38e5c
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
11 addition
and
11 deletion
+11
-11
src/modules/collector/log/reader/reader.go
src/modules/collector/log/reader/reader.go
+1
-1
src/modules/collector/log/strategy/strategy.go
src/modules/collector/log/strategy/strategy.go
+3
-3
src/modules/collector/log/worker/cached.go
src/modules/collector/log/worker/cached.go
+1
-1
src/modules/collector/log/worker/counter.go
src/modules/collector/log/worker/counter.go
+3
-3
src/modules/collector/log/worker/push.go
src/modules/collector/log/worker/push.go
+1
-1
src/modules/collector/log/worker/worker.go
src/modules/collector/log/worker/worker.go
+1
-1
src/modules/collector/stra/log.go
src/modules/collector/stra/log.go
+1
-1
未找到文件。
src/modules/collector/log/reader/reader.go
浏览文件 @
db0ab163
...
...
@@ -57,7 +57,7 @@ func (r *Reader) StartRead() {
var
readCnt
,
readSwp
int64
var
dropCnt
,
dropSwp
int64
analysClose
:=
make
(
chan
int
,
0
)
analysClose
:=
make
(
chan
int
)
go
func
()
{
for
{
// 十秒钟统计一次
...
...
src/modules/collector/log/strategy/strategy.go
浏览文件 @
db0ab163
...
...
@@ -14,7 +14,7 @@ var (
)
func
init
()
{
globalStrategy
=
make
(
map
[
int64
]
*
stra
.
Strategy
,
0
)
globalStrategy
=
make
(
map
[
int64
]
*
stra
.
Strategy
)
}
func
Update
()
error
{
...
...
@@ -22,7 +22,7 @@ func Update() error {
err
:=
UpdateGlobalStrategy
(
strategies
)
if
err
!=
nil
{
logger
.
Errorf
(
"Update Strategy cache error
! [msg:%v]
"
,
err
)
logger
.
Errorf
(
"Update Strategy cache error
:%v
\n
"
,
err
)
return
err
}
logger
.
Infof
(
"Update Strategy end"
)
...
...
@@ -30,7 +30,7 @@ func Update() error {
}
func
UpdateGlobalStrategy
(
sts
[]
*
stra
.
Strategy
)
error
{
tmpStrategyMap
:=
make
(
map
[
int64
]
*
stra
.
Strategy
,
0
)
tmpStrategyMap
:=
make
(
map
[
int64
]
*
stra
.
Strategy
)
for
_
,
st
:=
range
sts
{
if
st
.
Degree
==
0
{
st
.
Degree
=
6
...
...
src/modules/collector/log/worker/cached.go
浏览文件 @
db0ab163
...
...
@@ -25,7 +25,7 @@ type pushPointsCache struct {
Counters
map
[
string
]
*
counterCache
`json:"counters"`
}
var
globalPushPoints
=
pushPointsCache
{
Counters
:
make
(
map
[
string
]
*
counterCache
,
0
)}
var
globalPushPoints
=
pushPointsCache
{
Counters
:
make
(
map
[
string
]
*
counterCache
)}
func
init
()
{
go
CleanLoop
()
...
...
src/modules/collector/log/worker/counter.go
浏览文件 @
db0ab163
...
...
@@ -253,7 +253,7 @@ func (sc *StrategyCounter) AddTms(tms int64) error {
_
,
ok
:=
sc
.
TmsPoints
[
tms
]
if
!
ok
{
tmp
:=
new
(
PointsCounter
)
tmp
.
TagstringMap
=
make
(
map
[
string
]
*
PointCounter
,
0
)
tmp
.
TagstringMap
=
make
(
map
[
string
]
*
PointCounter
)
sc
.
TmsPoints
[
tms
]
=
tmp
}
sc
.
Unlock
()
...
...
@@ -300,7 +300,7 @@ func (gc *GlobalCounter) AddStrategyCount(st *stra.Strategy) {
if
_
,
ok
:=
gc
.
StrategyCounts
[
st
.
ID
];
!
ok
{
tmp
:=
new
(
StrategyCounter
)
tmp
.
Strategy
=
st
tmp
.
TmsPoints
=
make
(
map
[
int64
]
*
PointsCounter
,
0
)
tmp
.
TmsPoints
=
make
(
map
[
int64
]
*
PointsCounter
)
gc
.
StrategyCounts
[
st
.
ID
]
=
tmp
}
gc
.
Unlock
()
...
...
@@ -348,7 +348,7 @@ func (gc *GlobalCounter) cleanStrategyData(id int64) {
if
!
ok
||
sCount
==
nil
{
return
}
sCount
.
TmsPoints
=
make
(
map
[
int64
]
*
PointsCounter
,
0
)
sCount
.
TmsPoints
=
make
(
map
[
int64
]
*
PointsCounter
)
return
}
...
...
src/modules/collector/log/worker/push.go
浏览文件 @
db0ab163
...
...
@@ -165,7 +165,7 @@ func ToPushQueue(strategy *stra.Strategy, tms int64, pointMap map[string]*PointC
var
tags
map
[
string
]
string
if
tagstring
==
"null"
{
tags
=
make
(
map
[
string
]
string
,
0
)
tags
=
make
(
map
[
string
]
string
)
}
else
{
tags
=
dataobj
.
DictedTagstring
(
tagstring
)
}
...
...
src/modules/collector/log/worker/worker.go
浏览文件 @
db0ab163
...
...
@@ -136,7 +136,7 @@ func (w *Worker) Work() {
logger
.
Infof
(
"worker starting...[%s]"
,
w
.
Mark
)
var
anaCnt
,
anaSwp
int64
analysClose
:=
make
(
chan
int
,
0
)
analysClose
:=
make
(
chan
int
)
go
func
()
{
for
{
...
...
src/modules/collector/stra/log.go
浏览文件 @
db0ab163
...
...
@@ -165,7 +165,7 @@ func parsePattern(strategies []*Strategy) {
func
updateRegs
(
strategies
[]
*
Strategy
)
{
for
_
,
st
:=
range
strategies
{
st
.
TagRegs
=
make
(
map
[
string
]
*
regexp
.
Regexp
,
0
)
st
.
TagRegs
=
make
(
map
[
string
]
*
regexp
.
Regexp
)
st
.
ParseSucc
=
false
//更新时间正则
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录