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

refactor: only compute throughput for htcmock and bench #632

Merged
merged 3 commits into from
Feb 12, 2024

Conversation

aneojgurhem
Copy link
Contributor

No description provided.

@@ -428,4 +467,81 @@ await foreach (var resp in streamingCall.ResponseStream.ReadAllAsync(cancellatio
}
}
}


public static async Task<long> ComputeThroughput(this ChannelBase channel,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why long?

Copy link
Contributor Author

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 ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double

Comment on lines 539 to 545
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);
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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

lemaitre-aneo
lemaitre-aneo previously approved these changes Feb 12, 2024
@@ -428,4 +467,81 @@ await foreach (var resp in streamingCall.ResponseStream.ReadAllAsync(cancellatio
}
}
}


public static async Task<long> ComputeThroughput(this ChannelBase channel,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double

Comment on lines 539 to 545
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);
Copy link
Contributor

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

@aneojgurhem aneojgurhem merged commit cedf4ab into main Feb 12, 2024
78 checks passed
@aneojgurhem aneojgurhem deleted the jg/throughput branch February 12, 2024 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants