-
-
Notifications
You must be signed in to change notification settings - Fork 144
Expand file tree
/
Copy pathEnvironmentInfo.cs
More file actions
138 lines (117 loc) · 5.96 KB
/
Copy pathEnvironmentInfo.cs
File metadata and controls
138 lines (117 loc) · 5.96 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
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
136
137
138
using System.Text.Json.Serialization;
namespace Exceptionless.Models.Data {
public class EnvironmentInfo : IData {
public EnvironmentInfo() {
Data = new DataDictionary();
}
/// <summary>
/// Gets the number of processors for the current machine.
/// </summary>
/// <value>The number of processors for the current machine.</value>
public int ProcessorCount { get; set; }
/// <summary>
/// Gets the amount of physical memory for the current machine.
/// </summary>
/// <value>The amount of physical memory for the current machine.</value>
public long TotalPhysicalMemory { get; set; }
/// <summary>
/// Gets the amount of physical memory mapped to the process context.
/// </summary>
/// <value>The amount of physical memory mapped to the process context.</value>
public long AvailablePhysicalMemory { get; set; }
/// <summary>
/// Gets the command line information used to start the process.
/// </summary>
/// <value>The command line information used to start the process.</value>
public string CommandLine { get; set; }
/// <summary>
/// The name of the process that the error occurred in.
/// </summary>
public string ProcessName { get; set; }
/// <summary>
/// Gets the process id.
/// </summary>
/// <value>The process id.</value>
public string ProcessId { get; set; }
/// <summary>
/// Gets the amount of physical memory used by the process.
/// </summary>
/// <value>The amount of physical memory used by the process.</value>
public long ProcessMemorySize { get; set; }
/// <summary>
/// Gets the name of the thread.
/// </summary>
/// <value>The name of the thread.</value>
public string ThreadName { get; set; }
/// <summary>
/// Gets the win32 thread id.
/// </summary>
/// <value>The win32 thread id.</value>
public string ThreadId { get; set; }
/// <summary>
/// Gets the OS architecture.
/// </summary>
/// <value>The OS architecture.</value>
public string Architecture { get; set; }
/// <summary>
/// The OS name that the error occurred on.
/// </summary>
[JsonPropertyName("o_s_name")]
public string OSName { get; set; }
/// <summary>
/// The OS version that the error occurred on.
/// </summary>
[JsonPropertyName("o_s_version")]
public string OSVersion { get; set; }
/// <summary>
/// The Ip Address of the machine that the error occurred on.
/// </summary>
public string IpAddress { get; set; }
/// <summary>
/// The name of the machine that the error occurred on.
/// </summary>
public string MachineName { get; set; }
/// <summary>
/// A unique value identifying each Exceptionless client installation.
/// </summary>
public string InstallId { get; set; }
/// <summary>
/// The runtime version the application was running under when the error occurred.
/// </summary>
public string RuntimeVersion { get; set; }
/// <summary>
/// Extended data entries for this machine environment.
/// </summary>
public DataDictionary Data { get; set; }
protected bool Equals(EnvironmentInfo other) {
return ProcessorCount == other.ProcessorCount && TotalPhysicalMemory == other.TotalPhysicalMemory && AvailablePhysicalMemory == other.AvailablePhysicalMemory && string.Equals(CommandLine, other.CommandLine) && string.Equals(ProcessName, other.ProcessName) && string.Equals(ProcessId, other.ProcessId) && ProcessMemorySize == other.ProcessMemorySize && string.Equals(ThreadName, other.ThreadName) && string.Equals(ThreadId, other.ThreadId) && string.Equals(Architecture, other.Architecture) && string.Equals(OSName, other.OSName) && string.Equals(OSVersion, other.OSVersion) && string.Equals(IpAddress, other.IpAddress) && string.Equals(MachineName, other.MachineName) && string.Equals(InstallId, other.InstallId) && string.Equals(RuntimeVersion, other.RuntimeVersion) && Equals(Data, other.Data);
}
public override bool Equals(object obj) {
if (ReferenceEquals(null, obj))
return false;
if (ReferenceEquals(this, obj))
return true;
if (obj.GetType() != this.GetType())
return false;
return Equals((EnvironmentInfo)obj);
}
public override int GetHashCode() {
unchecked {
var hashCode = ProcessorCount;
hashCode = (hashCode * 397) ^ TotalPhysicalMemory.GetHashCode();
hashCode = (hashCode * 397) ^ (CommandLine == null ? 0 : CommandLine.GetHashCode());
hashCode = (hashCode * 397) ^ (ProcessName == null ? 0 : ProcessName.GetHashCode());
hashCode = (hashCode * 397) ^ (ProcessId == null ? 0 : ProcessId.GetHashCode());
hashCode = (hashCode * 397) ^ (Architecture == null ? 0 : Architecture.GetHashCode());
hashCode = (hashCode * 397) ^ (OSName == null ? 0 : OSName.GetHashCode());
hashCode = (hashCode * 397) ^ (OSVersion == null ? 0 :OSVersion.GetHashCode());
hashCode = (hashCode * 397) ^ (IpAddress == null ? 0 : IpAddress.GetHashCode());
hashCode = (hashCode * 397) ^ (MachineName == null ? 0 : MachineName.GetHashCode());
hashCode = (hashCode * 397) ^ (InstallId == null ? 0 : InstallId.GetHashCode());
hashCode = (hashCode * 397) ^ (RuntimeVersion == null ? 0 : RuntimeVersion.GetHashCode());
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetCollectionHashCode());
return hashCode;
}
}
}
}