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

Added response info middleware #4522

Conversation

vytautas-karpavicius
Copy link
Contributor

What changed?
Added outbound middleware for filling rpc.ResponseInfo structure.

Why?
This can be useful for a general way to obtain information about the response before it gets deserialized and returned to the client. One such example - obtaining serialized size of the message.

Intended usage example:

ctx, responseInfo := rpc.ContextWithResponseInfo(ctx)
resp, err := client.GetReplicationMessages(ctx, request, opts...)
messageSize := responseInfo.Size
...

How did you test it?
Added unit test, verified locally with print statement that message size can be obtained that way.

Potential risks

Release notes

Documentation Changes

@vytautas-karpavicius vytautas-karpavicius requested review from yux0 and a team September 30, 2021 10:42
@coveralls
Copy link

coveralls commented Sep 30, 2021

Pull Request Test Coverage Report for Build 415e369e-1251-4764-9541-588c28b36754

  • 15 of 15 (100.0%) changed or added relevant lines in 2 files are covered.
  • 101 unchanged lines in 11 files lost coverage.
  • Overall coverage decreased (-0.02%) to 56.48%

Files with Coverage Reduction New Missed Lines %
service/history/execution/mutable_state_task_refresher.go 1 73.82%
service/history/queue/timer_queue_processor_base.go 1 79.5%
common/task/fifoTaskScheduler.go 2 85.57%
service/history/queue/timer_queue_processor.go 2 59.33%
service/matching/taskListManager.go 2 74.09%
common/persistence/dataManagerInterfaces.go 3 60.91%
common/persistence/nosql/nosqlplugin/cassandra/workflow.go 3 50.23%
common/persistence/nosql/nosqlplugin/cassandra/tasks.go 14 72.8%
common/persistence/nosql/nosqlTaskStore.go 16 58.37%
common/persistence/nosql/nosqlplugin/cassandra/workflowUtils.go 20 77.03%
Totals Coverage Status
Change from base Build 6086fb9c-6671-48f2-9421-25018cdc2d1b: -0.02%
Covered Lines: 80464
Relevant Lines: 142465

💛 - Coveralls

@vytautas-karpavicius vytautas-karpavicius merged commit 9ba3b99 into cadence-workflow:master Sep 30, 2021
@vytautas-karpavicius vytautas-karpavicius deleted the response-info-middleware branch September 30, 2021 17:31
yux0 pushed a commit that referenced this pull request Oct 3, 2021
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.

3 participants