@page @using System.Runtime.InteropServices @using System.IO @using System.Diagnostics @model IndexModel @{ ViewData["Title"] = "Home page"; var process = Process.GetCurrentProcess(); }

Welcome to .NET Core

Environment

@RuntimeInformation.FrameworkDescription

@RuntimeInformation.OSDescription

Metrics
@if (RuntimeInformation.OSDescription.StartsWith("Linux") && Directory.Exists("/sys/fs/cgroup/memory")) { }
Containerized @(Environment.GetEnvironmentVariable("DOTNET_RUNNING_IN_CONTAINER") is object ? "true" : "false")
CPU cores @Environment.ProcessorCount
cgroup memory usage @System.IO.File.ReadAllLines("/sys/fs/cgroup/memory/memory.usage_in_bytes")[0]
Memory, current usage (bytes) @process.WorkingSet64
Memory, max available (bytes) @process.MaxWorkingSet