Skip to content

Commit

Permalink
docs: add land identifier and fix indentation
Browse files Browse the repository at this point in the history
the code blocks were rendering incorrectly, I believe because of the indentation in the file before the triple backticks
  • Loading branch information
brnhensley committed Feb 16, 2022
1 parent 3adbc30 commit c5d250d
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,10 @@ Here is a summary of known limitations for async instrumentation with our .NET a
>
It is expected for response time to be less than the total time spent in `async`-`await` usage scenerios. Consider the following code example for a web endpoint:

```
```cs
async Task<string> WebEndpointExample()
{
await DoSomethingForSomeSecondsAsync(5); //kick off a 5-second-work to be done.
return "Complete";
}

Expand All @@ -111,7 +110,7 @@ Here is a summary of known limitations for async instrumentation with our .NET a
{
await Task.Delay(TimeSpan.FromSeconds(seconds));
}
```
```

In this code example, it takes approximately 5 seconds for the `WebEndpointExample` to complete, so the response time for the transaction that represents the request to the `WebEndpointExample` endpoint will be approximately 5 seconds.

Expand All @@ -123,17 +122,14 @@ Here is a summary of known limitations for async instrumentation with our .NET a

At the same time, the agent cannot assume calling to `async` methods would always block the caller for the entire time. The next example demonstrates this:

```
```cs
async Task<string> WebEndpointExample()
{
var task = DoSomethingForSomeSecondsAsync(5); //kick off a 5-second-work to be done.
//
//Do something less than 5 seconds here.
//
await task;
return "Complete";
}

Expand All @@ -143,7 +139,7 @@ Here is a summary of known limitations for async instrumentation with our .NET a
{
await Task.Delay(TimeSpan.FromSeconds(seconds));
}
```
```

In this example, the response time is still approximately 5 seconds, but the actual execution time of the `WebEndpointExample` is no longer approximately 0.
</Collapser>
Expand Down

0 comments on commit c5d250d

Please sign in to comment.