-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Enable TCP states and ThreadPool stats #5003
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
:ref_current: https://www.elastic.co/guide/en/elasticsearch/reference/master | ||
|
||
:github: https://github.com/elastic/elasticsearch-net | ||
|
||
:nuget: https://www.nuget.org/packages | ||
|
||
//// | ||
IMPORTANT NOTE | ||
============== | ||
This file has been generated from https://github.com/elastic/elasticsearch-net/tree/master/src/Tests/Tests/ClientConcepts/Troubleshooting/DebugMode.doc.cs. | ||
If you wish to submit a PR for any spelling mistakes, typos or grammatical errors for this file, | ||
please modify the original csharp file found at the link and submit the PR with that change. Thanks! | ||
//// | ||
|
||
[[debug-mode]] | ||
=== Debug mode | ||
|
||
The <<debug-information, Debug information>> explains that every response from Elasticsearch.Net | ||
and NEST contains a `DebugInformation` property, and properties on `ConnectionSettings` and | ||
`RequestConfiguration` can control which additional information is included in debug information, | ||
for all requests or on a per request basis, respectively. | ||
|
||
During development, it can be useful to enable the most verbose debug information, to help | ||
identify and troubleshoot problems, or simply ensure that the client is behaving as expected. | ||
The `EnableDebugMode` setting on `ConnectionSettings` is a convenient shorthand for enabling | ||
verbose debug information, configuring a number of settings like | ||
|
||
* disabling direct streaming to capture request and response bytes | ||
|
||
* prettyfying JSON responses from Elasticsearch | ||
|
||
* collecting TCP statistics when a request is made | ||
|
||
* collecting thread pool statistics when a request is made | ||
|
||
* including the Elasticsearch stack trace in the response if there is a an error on the server side | ||
|
||
[source,csharp] | ||
---- | ||
IConnectionPool pool = new SingleNodeConnectionPool(new Uri("http://localhost:9200")); | ||
|
||
var settings = new ConnectionSettings(pool) | ||
.EnableDebugMode(); <1> | ||
|
||
var client = new ElasticClient(settings); | ||
|
||
var response = client.Search<Project>(s => s | ||
.Query(q => q | ||
.MatchAll() | ||
) | ||
); | ||
|
||
var debugInformation = response.DebugInformation; <2> | ||
---- | ||
<1> configure debug mode | ||
<2> verbose debug information | ||
|
||
In addition to exposing debug information on the response, debug mode will also cause the debug | ||
information to be written to the trace listeners in the `System.Diagnostics.Debug.Listeners` collection | ||
by default, when the request has completed. A delegate can be passed when enabling debug mode to perform | ||
a different action when a request has completed, using <<logging-with-on-request-completed, `OnRequestCompleted`>> | ||
|
||
[source,csharp] | ||
---- | ||
var pool = new SingleNodeConnectionPool(new Uri("http://localhost:9200")); | ||
var client = new ElasticClient(new ConnectionSettings(pool) | ||
.EnableDebugMode(apiCallDetails => | ||
{ | ||
// do something with the call details e.g. send with logging framework | ||
}) | ||
); | ||
---- | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
👍 💯