[CSHARP-1930] What is the alternative for 'Database.GetStats()' in MongoDB.Driver 2.4.2? Created: 03/Mar/17 Updated: 27/Oct/23 Resolved: 03/Mar/17 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | API, Documentation |
| Affects Version/s: | 2.4.2 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Blocker - P1 |
| Reporter: | Ummer Irshad | Assignee: | Robert Stam |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | question | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
OS : Win 7 |
||
| Description |
|
In MongoCsharpdriver 1.11.0, Database.GetStats() is available for getting the state of server. I have tried with ServerDescription object, but it is always returning as disconnected .During this time,I am able to access collections using the driver. Thanks in advance. |
| Comments |
| Comment by Robert Stam [ 08/Mar/17 ] | |||
|
The timeout question was moved to a new ticket: | |||
| Comment by Ummer Irshad [ 08/Mar/17 ] | |||
|
Dear Robert Stam, Is there any way to reduce the default command timeout of 30000ms of RunCommand in below code?
Thanks in advance. | |||
| Comment by Robert Stam [ 06/Mar/17 ] | |||
|
You're welcome. | |||
| Comment by Ummer Irshad [ 06/Mar/17 ] | |||
|
Thank you very much @Robert Stam for a quick reply. | |||
| Comment by Robert Stam [ 03/Mar/17 ] | |||
|
Drivers in general have moved away from providing very specific helper methods like GetStats for two reasons: 1. Few applications actually need them But you can easily run the underlying dbstats command yourself. The dbstats command is documented here: https://docs.mongodb.com/manual/reference/command/dbStats/ And your code would look like this:
|