Skip to content

Commit

Permalink
Introduce HostName to EnvironmentInfo.
Browse files Browse the repository at this point in the history
Remove unused variable.
  • Loading branch information
jaliyaudagedara committed Apr 9, 2023
1 parent 52f2c6e commit 8981107
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions samples/aspnetapp/aspnetapp/EnvironmentInfo.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Net;
using System.Runtime.InteropServices;

public struct EnvironmentInfo
Expand All @@ -12,15 +13,15 @@ public EnvironmentInfo()
return;
}

string[] memoryLimitPaths = new string[]
string[] memoryLimitPaths = new string[]
{
"/sys/fs/cgroup/memory.max",
"/sys/fs/cgroup/memory.high",
"/sys/fs/cgroup/memory.low",
"/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",
Expand All @@ -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) &&
Expand Down

0 comments on commit 8981107

Please sign in to comment.