You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Todd Lipcon (Code Review)" <ge...@cloudera.org> on 2016/08/29 04:40:21 UTC

[kudu-CR] tracing: gzip the trace JSON ajax response

Hello Mike Percy,

I'd like you to do a code review.  Please visit

    http://gerrit.cloudera.org:8080/4154

to review the following change.

Change subject: tracing: gzip the trace JSON ajax response
......................................................................

tracing: gzip the trace JSON ajax response

This enables gzipping of the actual trace which is sent back over HTTP
when using the tracing web page. I noticed that the traces can be quite
slow to receive, but given they often have a lot of repetitive text,
they are quite compressible.

The original Chrome implementation already did this, but I had ripped it
out for simplicity when importing the code. This simply adds it back on
the server side. A corresponding commit on the JS side adds a slight
tweak so that we can send back binary gzipped data (whereas the Chrome
version uses base64)

Change-Id: Ia8d5966e65b51576bf1460cb1ea8c2240ea88cbc
---
M src/kudu/server/tracing-path-handlers.cc
M src/kudu/tserver/tablet_server-test.cc
M thirdparty/vars.sh
3 files changed, 103 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/54/4154/1
-- 
To view, visit http://gerrit.cloudera.org:8080/4154
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia8d5966e65b51576bf1460cb1ea8c2240ea88cbc
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Mike Percy <mp...@apache.org>

[kudu-CR] tracing: gzip the trace JSON ajax response

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change.

Change subject: tracing: gzip the trace JSON ajax response
......................................................................


Patch Set 1:

Build Started http://104.196.14.100/job/kudu-gerrit/3125/

-- 
To view, visit http://gerrit.cloudera.org:8080/4154
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia8d5966e65b51576bf1460cb1ea8c2240ea88cbc
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-HasComments: No

[kudu-CR] tracing: gzip the trace JSON ajax response

Posted by "David Ribeiro Alves (Code Review)" <ge...@cloudera.org>.
David Ribeiro Alves has posted comments on this change.

Change subject: tracing: gzip the trace JSON ajax response
......................................................................


Patch Set 2: Code-Review+2

-- 
To view, visit http://gerrit.cloudera.org:8080/4154
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia8d5966e65b51576bf1460cb1ea8c2240ea88cbc
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: David Ribeiro Alves <dr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: No

[kudu-CR] tracing: gzip the trace JSON ajax response

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change.

Change subject: tracing: gzip the trace JSON ajax response
......................................................................


Patch Set 3:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/4154/3/src/kudu/server/tracing-path-handlers.cc
File src/kudu/server/tracing-path-handlers.cc:

PS3, Line 270: /tracing/json/end_recording_compressed
Does it make sense to rely on Content-Encoding HTTP header field instead?
https://en.wikipedia.org/wiki/HTTP_compression

I.e., compress the output regarding whether the HTTP client accepts gzipped content?


http://gerrit.cloudera.org:8080/#/c/4154/3/src/kudu/util/zlib.h
File src/kudu/util/zlib.h:

PS3, Line 20: #include <string>
Is it really needed?


Line 22: #include "kudu/util/status.h"
nit: consider including the header with Slice definition (kudu/util/slice.h ?)


-- 
To view, visit http://gerrit.cloudera.org:8080/4154
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia8d5966e65b51576bf1460cb1ea8c2240ea88cbc
Gerrit-PatchSet: 3
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <dr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: Yes

[kudu-CR] tracing: gzip the trace JSON ajax response

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has posted comments on this change.

Change subject: tracing: gzip the trace JSON ajax response
......................................................................


Patch Set 1:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/4154/1//COMMIT_MSG
Commit Message:

Line 18: version uses base64)
> nit: missing period
Done


http://gerrit.cloudera.org:8080/#/c/4154/1/src/kudu/server/tracing-path-handlers.cc
File src/kudu/server/tracing-path-handlers.cc:

Line 125: Status ZlibCompress(const string& input, stringstream* out) {
> maybe move this to some util place (don't feel strongly about it)
Done


http://gerrit.cloudera.org:8080/#/c/4154/1/src/kudu/tserver/tablet_server-test.cc
File src/kudu/tserver/tablet_server-test.cc:

Line 166: string ZlibUncompress(const faststring& compressed) {
> will do.
Done


-- 
To view, visit http://gerrit.cloudera.org:8080/4154
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia8d5966e65b51576bf1460cb1ea8c2240ea88cbc
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: David Ribeiro Alves <dr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: Yes

[kudu-CR] tracing: gzip the trace JSON ajax response

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has submitted this change and it was merged.

Change subject: tracing: gzip the trace JSON ajax response
......................................................................


tracing: gzip the trace JSON ajax response

This enables gzipping of the actual trace which is sent back over HTTP
when using the tracing web page. I noticed that the traces can be quite
slow to receive, but given they often have a lot of repetitive text,
they are quite compressible.

The original Chrome implementation already did this, but I had ripped it
out for simplicity when importing the code. This simply adds it back on
the server side. A corresponding commit on the JS side adds a slight
tweak so that we can send back binary gzipped data, whereas the Chrome
version uses base64.

Change-Id: Ia8d5966e65b51576bf1460cb1ea8c2240ea88cbc
Reviewed-on: http://gerrit.cloudera.org:8080/4154
Tested-by: Kudu Jenkins
Reviewed-by: David Ribeiro Alves <dr...@apache.org>
---
M src/kudu/server/tracing-path-handlers.cc
M src/kudu/tserver/tablet_server-test.cc
M src/kudu/util/CMakeLists.txt
A src/kudu/util/zlib.cc
A src/kudu/util/zlib.h
M thirdparty/vars.sh
6 files changed, 210 insertions(+), 13 deletions(-)

Approvals:
  David Ribeiro Alves: Looks good to me, approved
  Kudu Jenkins: Verified



-- 
To view, visit http://gerrit.cloudera.org:8080/4154
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia8d5966e65b51576bf1460cb1ea8c2240ea88cbc
Gerrit-PatchSet: 3
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: David Ribeiro Alves <dr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>

[kudu-CR] tracing: gzip the trace JSON ajax response

Posted by "David Ribeiro Alves (Code Review)" <ge...@cloudera.org>.
David Ribeiro Alves has posted comments on this change.

Change subject: tracing: gzip the trace JSON ajax response
......................................................................


Patch Set 1:

(5 comments)

http://gerrit.cloudera.org:8080/#/c/4154/1//COMMIT_MSG
Commit Message:

Line 16: the server side. A corresponding commit on the JS side adds a slight
question: don't we need both of these commits together to avoid breaking pulling the trace?


Line 18: version uses base64)
nit: missing period


http://gerrit.cloudera.org:8080/#/c/4154/1/src/kudu/server/tracing-path-handlers.cc
File src/kudu/server/tracing-path-handlers.cc:

Line 125: Status ZlibCompress(const string& input, stringstream* out) {
maybe move this to some util place (don't feel strongly about it)


PS1, Line 262: kEndRecordingCompressed
oh, I see, we support both compressed and decompressed, so it won't break anything, is that it?


http://gerrit.cloudera.org:8080/#/c/4154/1/src/kudu/tserver/tablet_server-test.cc
File src/kudu/tserver/tablet_server-test.cc:

Line 166: string ZlibUncompress(const faststring& compressed) {
yeah, seems like if we have both compress and decompress this could be in util/ no?


-- 
To view, visit http://gerrit.cloudera.org:8080/4154
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia8d5966e65b51576bf1460cb1ea8c2240ea88cbc
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: David Ribeiro Alves <dr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-HasComments: Yes

[kudu-CR] tracing: gzip the trace JSON ajax response

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change.

Change subject: tracing: gzip the trace JSON ajax response
......................................................................


Patch Set 2:

Build Started http://104.196.14.100/job/kudu-gerrit/3181/

-- 
To view, visit http://gerrit.cloudera.org:8080/4154
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia8d5966e65b51576bf1460cb1ea8c2240ea88cbc
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: David Ribeiro Alves <dr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: No

[kudu-CR] tracing: gzip the trace JSON ajax response

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has posted comments on this change.

Change subject: tracing: gzip the trace JSON ajax response
......................................................................


Patch Set 3:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/4154/3/src/kudu/server/tracing-path-handlers.cc
File src/kudu/server/tracing-path-handlers.cc:

PS3, Line 270: /tracing/json/end_recording_compressed
> Does it make sense to rely on Content-Encoding HTTP header field instead?
yea, I briefly considered that, but the way the web handler functions are currently registered, there's not actually any access to either retrieve or set any headers. I didn't want to scope-creep a small patch into redoing how web pages are registered/handled, so went with the "dumb" thing here. (also following what the upstream Chrome code does)


http://gerrit.cloudera.org:8080/#/c/4154/3/src/kudu/util/zlib.h
File src/kudu/util/zlib.h:

Line 22: #include "kudu/util/status.h"
> nit: consider including the header with Slice definition (kudu/util/slice.h
woops, will address these in a follow-up


-- 
To view, visit http://gerrit.cloudera.org:8080/4154
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia8d5966e65b51576bf1460cb1ea8c2240ea88cbc
Gerrit-PatchSet: 3
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <dr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: Yes

[kudu-CR] tracing: gzip the trace JSON ajax response

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has posted comments on this change.

Change subject: tracing: gzip the trace JSON ajax response
......................................................................


Patch Set 1:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/4154/1//COMMIT_MSG
Commit Message:

Line 16: the server side. A corresponding commit on the JS side adds a slight
> question: don't we need both of these commits together to avoid breaking pu
actually already pushed the trace-viewer commit, and this commit updates the hash in thirdparty


http://gerrit.cloudera.org:8080/#/c/4154/1/src/kudu/server/tracing-path-handlers.cc
File src/kudu/server/tracing-path-handlers.cc:

PS1, Line 262: kEndRecordingCompressed
> oh, I see, we support both compressed and decompressed, so it won't break a
yea, and also this patch does the update to the new version (though I left the non-compressed version since it might be useful in some cases)


http://gerrit.cloudera.org:8080/#/c/4154/1/src/kudu/tserver/tablet_server-test.cc
File src/kudu/tserver/tablet_server-test.cc:

Line 166: string ZlibUncompress(const faststring& compressed) {
> yeah, seems like if we have both compress and decompress this could be in u
will do.


-- 
To view, visit http://gerrit.cloudera.org:8080/4154
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia8d5966e65b51576bf1460cb1ea8c2240ea88cbc
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: David Ribeiro Alves <dr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: Yes

[kudu-CR] tracing: gzip the trace JSON ajax response

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins,

I'd like you to reexamine a change.  Please visit

    http://gerrit.cloudera.org:8080/4154

to look at the new patch set (#2).

Change subject: tracing: gzip the trace JSON ajax response
......................................................................

tracing: gzip the trace JSON ajax response

This enables gzipping of the actual trace which is sent back over HTTP
when using the tracing web page. I noticed that the traces can be quite
slow to receive, but given they often have a lot of repetitive text,
they are quite compressible.

The original Chrome implementation already did this, but I had ripped it
out for simplicity when importing the code. This simply adds it back on
the server side. A corresponding commit on the JS side adds a slight
tweak so that we can send back binary gzipped data, whereas the Chrome
version uses base64.

Change-Id: Ia8d5966e65b51576bf1460cb1ea8c2240ea88cbc
---
M src/kudu/server/tracing-path-handlers.cc
M src/kudu/tserver/tablet_server-test.cc
M src/kudu/util/CMakeLists.txt
A src/kudu/util/zlib.cc
A src/kudu/util/zlib.h
M thirdparty/vars.sh
6 files changed, 210 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/54/4154/2
-- 
To view, visit http://gerrit.cloudera.org:8080/4154
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia8d5966e65b51576bf1460cb1ea8c2240ea88cbc
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: David Ribeiro Alves <dr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>