diff --git a/samples/aspnetapp/aspnetapp/EnvironmentInfo.cs b/samples/aspnetapp/aspnetapp/EnvironmentInfo.cs index d271a8b565..238ff82b31 100644 --- a/samples/aspnetapp/aspnetapp/EnvironmentInfo.cs +++ b/samples/aspnetapp/aspnetapp/EnvironmentInfo.cs @@ -1,3 +1,4 @@ +using System.Net; using System.Runtime.InteropServices; public struct EnvironmentInfo @@ -12,7 +13,7 @@ public EnvironmentInfo() return; } - string[] memoryLimitPaths = new string[] + string[] memoryLimitPaths = new string[] { "/sys/fs/cgroup/memory.max", "/sys/fs/cgroup/memory.high", @@ -20,7 +21,7 @@ public EnvironmentInfo() "/sys/fs/cgroup/memory/memory.limit_in_bytes", }; - string[] currentMemoryPaths = new string[] + string[] currentMemoryPaths = new string[] { "/sys/fs/cgroup/memory.current", "/sys/fs/cgroup/memory/memory.usage_in_bytes", @@ -38,10 +39,10 @@ public EnvironmentInfo() public long TotalAvailableMemoryBytes { get; } public long MemoryLimit { get; } public long MemoryUsage { get; } + public string HostName => Dns.GetHostName(); private static long GetBestValue(string[] paths) { - string value = string.Empty; foreach (string path in paths) { if (Path.Exists(path) &&