-
Notifications
You must be signed in to change notification settings - Fork 812
/
NetSecurityMetrics.cs
89 lines (71 loc) · 2.84 KB
/
NetSecurityMetrics.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
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
namespace Yarp.Telemetry.Consumption;
/// <summary>
/// Represents metrics reported by the System.Net.Security event counters.
/// </summary>
public sealed class NetSecurityMetrics
{
public NetSecurityMetrics() => Timestamp = DateTime.UtcNow;
/// <summary>
/// Timestamp of when this <see cref="NetSecurityMetrics"/> instance was created.
/// </summary>
public DateTime Timestamp { get; internal set; }
/// <summary>
/// Number of TLS handshakes completed in the last metrics interval.
/// </summary>
public long TlsHandshakeRate { get; internal set; }
/// <summary>
/// Number of TLS handshakes completed since telemetry was enabled.
/// </summary>
public long TotalTlsHandshakes { get; internal set; }
/// <summary>
/// Number of active TLS handshakes that have started but not yet completed or failed.
/// </summary>
public long CurrentTlsHandshakes { get; internal set; }
/// <summary>
/// Number of TLS handshakes that failed since telemetry was enabled.
/// </summary>
public long FailedTlsHandshakes { get; internal set; }
/// <summary>
/// Number of currently open TLS sessions.
/// </summary>
public long TlsSessionsOpen { get; internal set; }
/// <summary>
/// Number of currently open TLS 1.0 sessions.
/// </summary>
public long Tls10SessionsOpen { get; internal set; }
/// <summary>
/// Number of currently open TLS 1.1 sessions.
/// </summary>
public long Tls11SessionsOpen { get; internal set; }
/// <summary>
/// Number of currently open TLS 1.2 sessions.
/// </summary>
public long Tls12SessionsOpen { get; internal set; }
/// <summary>
/// Number of currently open TLS 1.3 sessions.
/// </summary>
public long Tls13SessionsOpen { get; internal set; }
/// <summary>
/// Average duration of all TLS handshakes completed in the last metrics interval.
/// </summary>
public TimeSpan TlsHandshakeDuration { get; internal set; }
/// <summary>
/// Average duration of all TLS 1.0 handshakes completed in the last metrics interval.
/// </summary>
public TimeSpan Tls10HandshakeDuration { get; internal set; }
/// <summary>
/// Average duration of all TLS 1.1 handshakes completed in the last metrics interval.
/// </summary>
public TimeSpan Tls11HandshakeDuration { get; internal set; }
/// <summary>
/// Average duration of all TLS 1.2 handshakes completed in the last metrics interval.
/// </summary>
public TimeSpan Tls12HandshakeDuration { get; internal set; }
/// <summary>
/// Average duration of all TLS 1.3 handshakes completed in the last metrics interval.
/// </summary>
public TimeSpan Tls13HandshakeDuration { get; internal set; }
}