[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

split logs before upload ensure group size < 3M and log count < 4096 #17

Merged
merged 1 commit into from
Jun 12, 2019

Conversation

killagu
Copy link
Contributor
@killagu killagu commented Jun 11, 2019
Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change

@killagu killagu requested review from fengmk2 and popomore June 11, 2019 04:06
@codecov
Copy link
codecov bot commented Jun 11, 2019

Codecov Report

Merging #17 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #17   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           4      4           
  Lines          58     85   +27     
=====================================
+ Hits           58     85   +27
Impacted Files Coverage Δ
app.js 100% <100%> (ø) ⬆️
lib/sls_logger_client.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f48f96c...4f526d7. Read the comment docs.

@killagu
Copy link
Contributor Author
killagu commented Jun 11, 2019

上传后切割可能太大,直接超时。而不是 PostBodyTooLarge 的错误了。

this.emit('error', error);
return [{ group: null, logCount: 1 }];
}
const half = Math.floor(count / 2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是不是再多判断一下,如果 half 也超过限制了?可以根据 length 和 count 算出一个比较合理的数字,不一定是一分为二。

Copy link
Contributor Author
@killagu killagu Jun 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

计算 size 和 size limit 的比例,count 和 count limit 的比例。用两者中大的数去分组。

先用 4096 分组,然后再根据日志的平均大小分组

@killagu killagu force-pushed the fix/split-logic branch 8 times, most recently from bdc5ff3 to 3b95032 Compare June 11, 2019 18:42
@killagu killagu merged this pull request into master Jun 12, 2019
@killagu killagu deleted the fix/split-logic branch June 12, 2019 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants