-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Use async-http in monitor plugin #2447
Use async-http in monitor plugin #2447
Conversation
Hmm... async doesn't support 2.2 or earlier but fluentd still supports these version in this year. |
The smart way is http helper implements compatibility layer. |
72084c2
to
c8f751b
Compare
I did the former way! c8f751b |
Hi, these patches seems to be reasonable for me. 👍 I have a nitpick question. |
Signed-off-by: Yuta Iwama <ganmacs@gmail.com>
with http server helper which is async base Signed-off-by: Yuta Iwama <ganmacs@gmail.com>
becuase it does not support ruby version < 2.3 Signed-off-by: Yuta Iwama <ganmacs@gmail.com>
http is a bit ambiguous Signed-off-by: Yuta Iwama <ganmacs@gmail.com>
Signed-off-by: Yuta Iwama <ganmacs@gmail.com>
c8f751b
to
569257e
Compare
I'm going to add more tests later :) (So I changed this PR title into the one which starts with [WIP] ) |
569257e
to
8611f67
Compare
Signed-off-by: Yuta Iwama <ganmacs@gmail.com>
Signed-off-by: Yuta Iwama <ganmacs@gmail.com>
Signed-off-by: Yuta Iwama <ganmacs@gmail.com>
Signed-off-by: Yuta Iwama <ganmacs@gmail.com>
8611f67
to
7947e54
Compare
Ready to be reviewed! @cosmo0920 @repeatedly could you review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. 😄
These http_server plugin helper implementation is greater than I had thought. 😁
end | ||
|
||
def start(notify = nil) | ||
@logger.debug("Start HTTP server listening #{@uri}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For debug, I want async-http in the log like below
Start async HTTP server listening #{@uri}"
end | ||
|
||
def start(notify = nil) | ||
build_handler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger.debug
with Start webrick HTTP server listening
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4b48997 fixed
render_json(resp, code: code, pretty_json: pretty_json) | ||
end | ||
|
||
def render_json(obj, code: 200, **opts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
render_json
accepts only pretty_json
so how about replace **opts
with pretty_json: false
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right 42fd38f
Signed-off-by: Yuta Iwama <ganmacs@gmail.com>
Signed-off-by: Yuta Iwama <ganmacs@gmail.com>
Thanks! |
@ganmacs Could you send the patch to add http_server article to gitbook? |
will do! |
depends on #2424, last 2 commits are for this patch.
Which issue(s) this PR fixes:
no
What this PR does / why we need it:
in_monitor_agent: Replace webrick base HTTP server with async-http base HTTP server.
Simple benchmark: https://gist.github.com/ganmacs/3f7984930a3cd9109bfbb8a2ca5d6991
Docs Changes:
noAdd http_server helper document
Release Note:
monitor_agent uses async-http base HTTP server instead of webrick base HTTP server