-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathCommunicationStatistics.cs
More file actions
104 lines (93 loc) · 2.32 KB
/
CommunicationStatistics.cs
File metadata and controls
104 lines (93 loc) · 2.32 KB
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
using System;
using System.Collections.Generic;
using Waher.Events.Statistics;
namespace Waher.Networking.HTTP
{
/// <summary>
/// Contains communication statistics.
/// </summary>
public class CommunicationStatistics
{
private Dictionary<string, Statistic> callsPerMethod;
private Dictionary<string, Statistic> callsPerUserAgent;
private Dictionary<string, Statistic> callsPerFrom;
private Dictionary<string, Statistic> callsPerResource;
private DateTime lastStat;
private DateTime currentStat;
private long nrBytesRx;
private long nrBytesTx;
private long nrCalls;
/// <summary>
/// Calls per method.
/// </summary>
public Dictionary<string, Statistic> CallsPerMethod
{
get => this.callsPerMethod;
internal set => this.callsPerMethod = value;
}
/// <summary>
/// Calls per User Agent header value.
/// </summary>
public Dictionary<string, Statistic> CallsPerUserAgent
{
get => this.callsPerUserAgent;
internal set => this.callsPerUserAgent = value;
}
/// <summary>
/// Calls per From header value.
/// </summary>
public Dictionary<string, Statistic> CallsPerFrom
{
get => this.callsPerFrom;
internal set => this.callsPerFrom = value;
}
/// <summary>
/// Calls per resource.
/// </summary>
public Dictionary<string, Statistic> CallsPerResource
{
get => this.callsPerResource;
internal set => this.callsPerResource = value;
}
/// <summary>
/// Timestamp of last statistics. If <see cref="DateTime.MinValue"/>, no statistics has been retrieved since restart of server.
/// </summary>
public DateTime LastStat
{
get => this.lastStat;
internal set => this.lastStat = value;
}
/// <summary>
/// Timestamp of current statistics.
/// </summary>
public DateTime CurrentStat
{
get => this.currentStat;
internal set => this.currentStat = value;
}
/// <summary>
/// Number of bytes received.
/// </summary>
public long NrBytesRx
{
get => this.nrBytesRx;
internal set => this.nrBytesRx = value;
}
/// <summary>
/// Number of bytes transmitted.
/// </summary>
public long NrBytesTx
{
get => this.nrBytesTx;
internal set => this.nrBytesTx = value;
}
/// <summary>
/// Number of method calls.
/// </summary>
public long NrCalls
{
get => this.nrCalls;
internal set => this.nrCalls = value;
}
}
}