/
AnalyzerTelemetry.cs
135 lines (110 loc) · 5 KB
/
AnalyzerTelemetry.cs
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
namespace Microsoft.CodeAnalysis.Diagnostics.Telemetry
{
/// <summary>
/// Contains telemetry info for a specific analyzer, such as count of registered actions, the total execution time, etc.
/// </summary>
public sealed class AnalyzerTelemetryInfo
{
/// <summary>
/// Count of registered compilation start actions.
/// </summary>
public int CompilationStartActionsCount { get; set; } = 0;
/// <summary>
/// Count of registered compilation end actions.
/// </summary>
public int CompilationEndActionsCount { get; set; } = 0;
/// <summary>
/// Count of registered compilation actions.
/// </summary>
public int CompilationActionsCount { get; set; } = 0;
/// <summary>
/// Count of registered syntax tree actions.
/// </summary>
public int SyntaxTreeActionsCount { get; set; } = 0;
/// <summary>
/// Count of registered semantic model actions.
/// </summary>
public int SemanticModelActionsCount { get; set; } = 0;
/// <summary>
/// Count of registered symbol actions.
/// </summary>
public int SymbolActionsCount { get; set; } = 0;
/// <summary>
/// Count of registered symbol start actions.
/// </summary>
public int SymbolStartActionsCount { get; set; } = 0;
/// <summary>
/// Count of registered symbol end actions.
/// </summary>
public int SymbolEndActionsCount { get; set; } = 0;
/// <summary>
/// Count of registered syntax node actions.
/// </summary>
public int SyntaxNodeActionsCount { get; set; } = 0;
/// <summary>
/// Count of registered code block start actions.
/// </summary>
public int CodeBlockStartActionsCount { get; set; } = 0;
/// <summary>
/// Count of registered code block end actions.
/// </summary>
public int CodeBlockEndActionsCount { get; set; } = 0;
/// <summary>
/// Count of registered code block actions.
/// </summary>
public int CodeBlockActionsCount { get; set; } = 0;
/// <summary>
/// Count of registered operation actions.
/// </summary>
public int OperationActionsCount { get; set; } = 0;
/// <summary>
/// Count of registered operation block start actions.
/// </summary>
public int OperationBlockStartActionsCount { get; set; } = 0;
/// <summary>
/// Count of registered operation block end actions.
/// </summary>
public int OperationBlockEndActionsCount { get; set; } = 0;
/// <summary>
/// Count of registered operation block actions.
/// </summary>
public int OperationBlockActionsCount { get; set; } = 0;
/// <summary>
/// Total execution time.
/// </summary>
public TimeSpan ExecutionTime { get; set; } = TimeSpan.Zero;
/// <summary>
/// Gets a value indicating whether the analyzer supports concurrent execution.
/// </summary>
public bool Concurrent { get; set; }
internal AnalyzerTelemetryInfo(AnalyzerActionCounts actionCounts, TimeSpan executionTime)
{
CompilationStartActionsCount = actionCounts.CompilationStartActionsCount;
CompilationEndActionsCount = actionCounts.CompilationEndActionsCount;
CompilationActionsCount = actionCounts.CompilationActionsCount;
SyntaxTreeActionsCount = actionCounts.SyntaxTreeActionsCount;
SemanticModelActionsCount = actionCounts.SemanticModelActionsCount;
SymbolActionsCount = actionCounts.SymbolActionsCount;
SymbolStartActionsCount = actionCounts.SymbolStartActionsCount;
SymbolEndActionsCount = actionCounts.SymbolEndActionsCount;
SyntaxNodeActionsCount = actionCounts.SyntaxNodeActionsCount;
CodeBlockStartActionsCount = actionCounts.CodeBlockStartActionsCount;
CodeBlockEndActionsCount = actionCounts.CodeBlockEndActionsCount;
CodeBlockActionsCount = actionCounts.CodeBlockActionsCount;
OperationActionsCount = actionCounts.OperationActionsCount;
OperationBlockStartActionsCount = actionCounts.OperationBlockStartActionsCount;
OperationBlockEndActionsCount = actionCounts.OperationBlockEndActionsCount;
OperationBlockActionsCount = actionCounts.OperationBlockActionsCount;
ExecutionTime = executionTime;
Concurrent = actionCounts.Concurrent;
}
/// <summary>
/// Create telemetry info for a specific analyzer, such as count of registered actions, the total execution time, etc.
/// </summary>
public AnalyzerTelemetryInfo()
{
}
}
}