Repository navigation
获取 read parse transform send 历史错误信息,默人历史错误条数最大为100条 - #610
Merged
Merged
Conversation
unknwon
suggested changes
Jul 17, 2018
| //"runnerDataIntegrityTest": runnerDataIntegrityTest, | ||
| //"getErrorCodeTest": getErrorCodeTest, | ||
| //"getRunnersTest": getRunnersTest, | ||
| //"senderRouterTest": senderRouterTest, |
| } | ||
| if err != nil { | ||
| info.LastError = err.Error() | ||
| r.errorsMutex.Lock() |
Contributor
There was a problem hiding this comment.
既然不同步骤的 error 是单独的 queue,为什么不直接把锁封装在 queue 的 put 操作里?
| } | ||
|
|
||
| func NewErrorQueue() *ErrorQueue { | ||
| errorQueue := &ErrorQueue{} |
Contributor
There was a problem hiding this comment.
这里完全可以
return &ErrorQueue{
xxx
xxx
}| assert.NotEqual(t, exp, pick) | ||
| } | ||
|
|
||
| func TestErrorQueue(t *testing.T) { |
Contributor
There was a problem hiding this comment.
为什么定义是在 models.go 里,test 却是在 utils_test.go?
redHJ
force-pushed
the
pdr-6810
branch
5 times, most recently
from
July 18, 2018 01:52
638649a to
9a99846
Compare
wonderflow
reviewed
Jul 18, 2018
| 请求 | ||
|
|
||
| ``` | ||
| GET /logkit/errors |
wonderflow
reviewed
Jul 18, 2018
| "send_errors": { | ||
| { | ||
| "error":"<send error info>"", | ||
| "unix_nano_time":<unix nano time> |
wonderflow
reviewed
Jul 18, 2018
| * "parse_errors": parse 历史错误数据 | ||
| * "transform_errors": transform 历史错误数据 | ||
| * "send_errors": send 历史错误数据 | ||
| * "error": 具体错误信息 |
Contributor
There was a problem hiding this comment.
你这个接口就是errors,不用到处加errors后缀,就叫 read,parse,transfoerm,send就好了。
wonderflow
reviewed
Jul 18, 2018
| MaxBatchSize int `json:"batch_size,omitempty"` // 每个read batch的字节数 | ||
| MaxBatchInterval int `json:"batch_interval,omitempty"` // 最大发送时间间隔 | ||
| MaxBatchTryTimes int `json:"batch_try_times,omitempty"` // 最大发送次数,小于等于0代表无限重试 | ||
| MaxErrorsSize int `json:"errors_size"` // 记录错误信息的最大条数 |
wonderflow
reviewed
Jul 18, 2018
|
|
||
| DefaultMaxBatchSize = 2 * 1024 * 1024 | ||
|
|
||
| DefaultErrorQueueSize = 50 |
redHJ
force-pushed
the
pdr-6810
branch
11 times, most recently
from
July 23, 2018 09:31
62ff6aa to
14dc801
Compare
redHJ
force-pushed
the
pdr-6810
branch
4 times, most recently
from
July 23, 2018 12:06
7989484 to
ab440ca
Compare
redHJ
force-pushed
the
pdr-6810
branch
3 times, most recently
from
July 25, 2018 08:18
2202e1c to
bdb52cc
Compare
redHJ
force-pushed
the
pdr-6810
branch
7 times, most recently
from
July 26, 2018 02:03
f5580e6 to
8e818cb
Compare
unknwon
suggested changes
Jul 26, 2018
| entry.SendErrors = nil | ||
| } | ||
|
|
||
| //Clone 复制出一个顺序的 Errors |
| return dst | ||
| } | ||
|
|
||
| //Clone 复制出一个顺序的 Errors |
redHJ
force-pushed
the
pdr-6810
branch
2 times, most recently
from
July 26, 2018 07:58
c5ce966 to
ed7b546
Compare
unknwon
reviewed
Jul 26, 2018
| if change { | ||
| return &dst | ||
| } | ||
| return nil |
Contributor
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
获取 read parse transform send 历史错误信息,默人历史错误条数最大为100条