influxdb/grpc-binary-logger/examples
Marko Mikulicic 15369d4c52
feat: Implement gRPC binary logger (#5473)
* feat: Implement gRPC binary logger

* chore: Run cargo hakari tasks

* fix: Apply suggestions from code review

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>

Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-09-01 10:57:02 +00:00
..
README.md feat: Implement gRPC binary logger (#5473) 2022-09-01 10:57:02 +00:00
client.rs feat: Implement gRPC binary logger (#5473) 2022-09-01 10:57:02 +00:00
server.rs feat: Implement gRPC binary logger (#5473) 2022-09-01 10:57:02 +00:00

README.md

example usage

Run server:

cargo run -p grpc-binary-logger --example server

Run client:

cargo run -p grpc-binary-logger --example client

View binary log:

$ go install mkm.pub/binlog
$ binlog stats /tmp/grpcgo_binarylog.bin
Method			[≥0s]	[≥0.05s][≥0.1s]	[≥0.2s]	[≥0.5s]	[≥1s]	[≥10s]	[≥100s]	[errors]
/test.Test/TestUnary	1	0	0	0	0	0	0	0
$ binlog debug /tmp/grpcgo_binarylog.bin
1	EVENT_TYPE_CLIENT_HEADER	/test.Test/TestUnary
1	EVENT_TYPE_CLIENT_MESSAGE
1	EVENT_TYPE_SERVER_HEADER
1	EVENT_TYPE_SERVER_MESSAGE
1	EVENT_TYPE_SERVER_TRAILER
$ binlog view /tmp/grpcgo_binarylog.bin
ID	When				Elapsed	Method			Status
1	2022/08/24 14:33:08.736308	1.217ms	/test.Test/TestUnary	OK