Skip to content

Commit

Permalink
docs: attempt to fix code formatting
Browse files Browse the repository at this point in the history
attempt #2 to fix the code formatting, it's unclear why the first line in this example is not getting it's indentation:

```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";
    }

    [Trace]
    [MethodImpl(MethodImplOptions.NoInlining)]
    private static async Task DoSomethingForSomeSecondsAsync(int seconds)
    {
        await Task.Delay(TimeSpan.FromSeconds(seconds));
    }
```
  • Loading branch information
brnhensley committed Feb 16, 2022
1 parent c5d250d commit 670cd53
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ 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
```cs
async Task<string> WebEndpointExample()
{
await DoSomethingForSomeSecondsAsync(5); //kick off a 5-second-work to be done.
Expand All @@ -110,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 @@ -122,7 +122,7 @@ 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
```cs
async Task<string> WebEndpointExample()
{
var task = DoSomethingForSomeSecondsAsync(5); //kick off a 5-second-work to be done.
Expand All @@ -139,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 670cd53

Please sign in to comment.