-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
47 lines (40 loc) · 679 Bytes
/
Copy pathProgram.cs
File metadata and controls
47 lines (40 loc) · 679 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Threading;
using System.Threading.Tasks;
using Aspects;
namespace OpenTelemetryAspect
{
static class Program
{
static void Main()
{
using var __ = OpenTelemetryFactory.Create();
Method1();
Method2();
Method1();
MethodException();
_ = AsyncMethod().Result;
}
[Metrics]
public static void Method1()
{
Thread.Sleep(100);
}
[Metrics]
public static void Method2()
{
Thread.Sleep(200);
}
[IgnoreCatch, Metrics]
public static void MethodException()
{
throw new();
}
[Metrics]
public static Task<string> AsyncMethod()
{
Thread.Sleep(150);
return Task.FromResult("123");
}
}
}