-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
Provide the RU's used by an operation #275
Comments
Hi @SeanFarrow we do support this for some of the paging APIs. I think we could start logging this out if that is any help? We do in places but I think they are logged at |
@mumby0168 I'm using AppInsights, so use TelemetryClient to track this as a specific metric. I am right in that the second would make more sense? Or, do you have any other options? |
Hi @SeanFarrow we would not want to modify the public API surface I do not think. So I don't think either the out parameter or the return type would work in this case. One option might be a set of new methods to all existing methods that allow you to collect the cost. But they would have to be new methods with new names. If we was to do that, I think I would prefer the return type option. |
This seems like a cross-cutting concern - might it somehow be managed with an enclosing scope or wrapper class? Perhaps our core impl adds an pub/sub notification model using something like Mediatr for telemetry metrics of interest, including RUs, then those consumers that care can subscribe to those. That way it could be pay-to-play without adding complexity to the core API. |
I was thinking exactly this, maybe have an IMetricsTracker interface that can be passed in (but defaults to null if you don’t), then consumers that want this can implement there own. Of course we might want to provide implementations ourselves.
From: dcuccia ***@***.***>
Sent: 18 May 2022 15:47
To: IEvangelist/azure-cosmos-dotnet-repository ***@***.***>
Cc: Sean Farrow ***@***.***>; Mention ***@***.***>
Subject: Re: [IEvangelist/azure-cosmos-dotnet-repository] Provide the RU's used by an operation (Issue #275)
This seems like a cross-cutting concern - might it somehow be managed with an enclosing scope or wrapper class? Perhaps our core impl adds an pub/sub notification model using something like Mediatr for telemetry metrics of interest, including RUs, then those consumers that care can subscribe to those. That way it could be pay-to-play without adding complexity to the core API.
—
Reply to this email directly, view it on GitHub<#275 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AALDK7XXVQGWSOSBU3T4PG3VKT7IDANCNFSM5V2MUPGQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@SeanFarrow @mumby0168 if we published Mediatr-style events such as those demoed here: https://youtu.be/NmmpXcMxCjY?t=665 ...then the consuming code could follow a wrapper pattern like this: https://www.youtube.com/watch?v=dLPKwEeqwgU&t=705s (using Nick Chapsas videos as shortcuts...could publish some sample code when I have time this weekend) |
Hi, |
@all-contributors please add @SeanFarrow for idea |
I've put up a pull request to add @SeanFarrow! 🎉 |
I'm just starting to use this to replace a self-written interface to Cosmos.
The one thing my current interface gives me is the RU cost of an operation.
Could this be surfaced in some way through the repository interface(s)?
The Two options I can think of currently are introducing an ItemWrapper, rather than IItem--although you may want to keep this as it is useful, or extending IItem itself.
To my thinking the former is the better option, kind of like an HttpResponse.
The text was updated successfully, but these errors were encountered: