Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
d7079b20
Commit
d7079b20
authored
7 years ago
by
Jan Tattermusch
Browse files
Options
Downloads
Patches
Plain Diff
cache byteBufRequest for generic C# qps client
parent
8ca00556
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/csharp/Grpc.IntegrationTesting/ClientRunners.cs
+3
-6
3 additions, 6 deletions
src/csharp/Grpc.IntegrationTesting/ClientRunners.cs
with
3 additions
and
6 deletions
src/csharp/Grpc.IntegrationTesting/ClientRunners.cs
+
3
−
6
View file @
d7079b20
...
...
@@ -140,6 +140,7 @@ namespace Grpc.IntegrationTesting
readonly
ClientType
clientType
;
readonly
RpcType
rpcType
;
readonly
PayloadConfig
payloadConfig
;
readonly
Lazy
<
byte
[
]>
cachedByteBufferRequest
;
readonly
Histogram
histogram
;
readonly
List
<
Task
>
runnerTasks
;
...
...
@@ -155,6 +156,7 @@ namespace Grpc.IntegrationTesting
this
.
clientType
=
clientType
;
this
.
rpcType
=
rpcType
;
this
.
payloadConfig
=
payloadConfig
;
this
.
cachedByteBufferRequest
=
new
Lazy
<
byte
[
]>
(()
=>
new
byte
[
payloadConfig
.
BytebufParams
.
ReqSize
]);
this
.
histogram
=
new
Histogram
(
histogramParams
.
Resolution
,
histogramParams
.
MaxPossible
);
this
.
runnerTasks
=
new
List
<
Task
>();
...
...
@@ -286,7 +288,7 @@ namespace Grpc.IntegrationTesting
private
async
Task
RunGenericStreamingAsync
(
Channel
channel
,
IInterarrivalTimer
timer
)
{
var
request
=
Create
ByteBufferRequest
()
;
var
request
=
cached
ByteBufferRequest
.
Value
;
var
stopwatch
=
new
Stopwatch
();
var
callDetails
=
new
CallInvocationDetails
<
byte
[],
byte
[
]>
(
channel
,
GenericService
.
StreamingCallMethod
,
new
CallOptions
());
...
...
@@ -351,11 +353,6 @@ namespace Grpc.IntegrationTesting
};
}
private
byte
[]
CreateByteBufferRequest
()
{
return
new
byte
[
payloadConfig
.
BytebufParams
.
ReqSize
];
}
private
static
Payload
CreateZerosPayload
(
int
size
)
{
return
new
Payload
{
Body
=
ByteString
.
CopyFrom
(
new
byte
[
size
])
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment