public JsonResult Get(HealthCheckTypes checkType = HealthCheckTypes.Shallow) { var man = new SystemHealthManager(); var status = man.PerformHealthCheck(checkType); return(Json(status)); }
public HealthCheckStatus PerformHealthCheck(HealthCheckTypes checkType) { //switch type var status = new HealthCheckStatus(); var p = Process.GetCurrentProcess(); status = new HealthCheckStatus { Threads = p.Threads.Count, UptimeInMinutes = (DateTime.Now - p.StartTime).TotalMinutes, RamInMBytes = (int)p.PeakWorkingSet64 / 1024 / 1024, Version = Assembly.GetExecutingAssembly().GetName().Version.ToString(), Name = "Email service on " + Environment.MachineName, IPAddress = GetLocalIPAddress(), FreeDiskSpaceGb = FreeDiskSpaceGb(Path.GetPathRoot(Assembly.GetEntryAssembly().Location)) }; return(status); }