Beispiel #1
0
        public ActionResult <string> Ping()
        {
            var envInfo = cubesEnvironment.GetEnvironmentInformation();
            var proc    = Process.GetCurrentProcess();
            var info    = new
            {
                ProcID           = proc.Id,
                ProcessName      = proc.ProcessName,
                Executable       = Path.GetFileName(proc.MainModule.FileName),
                Assembly         = Assembly.GetEntryAssembly().GetName().Name,
                WorkingFolder    = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location),
                Machine          = proc.MachineName,
                Hostname         = envInfo.Hostname,
                KernelVersion    = envInfo.BuildVersion,
                GitHash          = envInfo.GitHash,
                Build            = envInfo.IsDebug ? "DEBUG" : "RELEASE",
                BuildTime        = envInfo.BuildDateTime.ToString("yyyy-MM-dd HH:mm:ss"),
                LiveSince        = envInfo.LiveSince.ToString("yyyy-MM-dd HH:mm:ss"),
                ServerTime       = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                WorkingSet       = Math.Round(proc.WorkingSet64 / 1024M / 1024M, 2),
                PeakWorkingSet   = Math.Round(proc.PeakWorkingSet64 / 1024M / 1024M, 2),
                Threads          = proc.Threads.Count,
                LoadedAssemblies = cubesEnvironment.GetLoadedAssemblies(),
                ConfiguredApps   = cubesEnvironment.GetApplications(),
                ActivatedApps    = cubesEnvironment.GetActivatedApplications().Select(app => app.GetType().Name)
            };

            return(Ok(info));
        }