Exemplo n.º 1
0
        public bool AddMachineStatus(LogMachine status)
        {
            bool result;

            try
            {
                this.LogMachines.InsertOnSubmit(status);
                result = true;
            }
            catch (Exception value)
            {
                Console.WriteLine(value);
                result = false;
            }
            return(result);
        }
Exemplo n.º 2
0
        public void Update()
        {
            LogMachine item = new LogMachine
            {
                TimeStamp           = DateTime.Now,
                CpuUse              = this.CpuUse,
                PhysicalMemoryUse   = (long)this.AvailablePhysicalMemory,
                PhysicalMemoryLimit = (long)this.PhysicalMemoryLimit,
                VirtualMemoryUse    = (long)this.VirtualMemoryUse,
                VirtualMemoryLimit  = (long)this.VirtualMemoryLimit,
                NetworkSent         = (long)this.GetNetworkUse(SystemMonitor.NetworkAccessType.Sent),
                NetworkReceived     = (long)this.GetNetworkUse(SystemMonitor.NetworkAccessType.Received),
                MachineName         = Environment.MachineName
            };

            this.machineStatusCache.Add(item);
        }