-
Notifications
You must be signed in to change notification settings - Fork 8
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
refactor: only compute throughput for htcmock and bench #632
Conversation
@@ -428,4 +467,81 @@ await foreach (var resp in streamingCall.ResponseStream.ReadAllAsync(cancellatio | |||
} | |||
} | |||
} | |||
|
|||
|
|||
public static async Task<long> ComputeThroughput(this ChannelBase channel, |
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.
Why long?
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.
Seemed a good idea. What do you suggest ?
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.
double
logger.LogInformation("Throughput for session {session} : {sessionThroughput} task/s ({nTasks} tasks in {timespan})", | ||
sessionId, | ||
count / sessionDuration.TotalMilliseconds * 1000, | ||
count, | ||
sessionDuration); | ||
|
||
return (long)(sessionDuration.TotalMilliseconds * 1000 / count); |
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.
If you print the throughtput in this function, it can return void.
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.
I thought that if someone need to present the data in another way, it would be good to return the info.
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.
Then, I would recommend to put the logs outside
@@ -428,4 +467,81 @@ await foreach (var resp in streamingCall.ResponseStream.ReadAllAsync(cancellatio | |||
} | |||
} | |||
} | |||
|
|||
|
|||
public static async Task<long> ComputeThroughput(this ChannelBase channel, |
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.
double
logger.LogInformation("Throughput for session {session} : {sessionThroughput} task/s ({nTasks} tasks in {timespan})", | ||
sessionId, | ||
count / sessionDuration.TotalMilliseconds * 1000, | ||
count, | ||
sessionDuration); | ||
|
||
return (long)(sessionDuration.TotalMilliseconds * 1000 / count); |
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.
Then, I would recommend to put the logs outside
No description provided.