• Welcome to Valhalla Legends Archive.
 

Active System Information Updates

Started by Mephisto, May 24, 2004, 10:31 PM

Previous topic - Next topic

Tuberload

Quote from: Eli_1 on May 25, 2004, 05:42 AM
I'm glad to see the regular forum flamers were able to stop by and waste everyone's time -- again.

A good 70% of the posts on this forum could be concidered a waste of time, so please don't pass out all the credit to the participants of this thread. Besides I don't see how anyone here is a regular flamer...
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

Mephisto


effect

Quote from: Mangix on March 22, 2005, 03:03 AM
i am an expert Stealthbot VBScript. Recognize Bitch.

Noodlez

Download SiSoft Sandra, it is free software that displays nearly everything about your computer.

Mephisto

Quote from: Noodlez on May 25, 2004, 11:51 AM
Download SiSoft Sandra, it is free software that displays nearly everything about your computer.

Can you provide a link?  Their Website is hell to navigate through for me...

Eli_1

Quote from: Tuberload on May 25, 2004, 06:14 AM
A good 70% of the posts on this forum could be concidered a waste of time, so please don't pass out all the credit to the participants of this thread. Besides I don't see how anyone here is a regular flamer...

Yea, I'm sorry about that. It was really early and I didn't read some of the responses clearly -- I could have sworn I saw someone tell Mephisto to "get a life."

Tuberload

Quote from: Eli_1 on May 25, 2004, 02:03 PM
Quote from: Tuberload on May 25, 2004, 06:14 AM
A good 70% of the posts on this forum could be concidered a waste of time, so please don't pass out all the credit to the participants of this thread. Besides I don't see how anyone here is a regular flamer...

Yea, I'm sorry about that. It was really early and I didn't read some of the responses clearly -- I could have sworn I saw someone tell Mephisto to "get a life."


Please don't apologize to me, I am sorry as well. I was more defending myself as to being a regular flamer. I wasn't really attempting to flame, just sticking up for a friend the same way other people were.
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

Tuberload

Quote from: Mephisto on May 25, 2004, 09:04 AM
*shrug*

I didn't really expect you to understand the reasoning or the meaning of my post, so I guess I will just *shrug* as well.
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

Mephisto

Quote from: Tuberload on May 25, 2004, 04:49 PM
Quote from: Mephisto on May 25, 2004, 09:04 AM
*shrug*

I didn't really expect you to understand the reasoning or the meaning of my post, so I guess I will just *shrug* as well.

It was actually pretty obvious...You couldn't have made it much clearer...I just didn't agree...Unless of course I'm way off and mis-interpreted the whole thing...

Tuberload

Quote from: Mephisto on May 25, 2004, 06:00 PM
Quote from: Tuberload on May 25, 2004, 04:49 PM
Quote from: Mephisto on May 25, 2004, 09:04 AM
*shrug*

I didn't really expect you to understand the reasoning or the meaning of my post, so I guess I will just *shrug* as well.

It was actually pretty obvious...You couldn't have made it much clearer...I just didn't agree...Unless of course I'm way off and mis-interpreted the whole thing...

I am going to continue this on IM.
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

Noodlez

Quote from: Mephisto on May 25, 2004, 02:02 PM
Quote from: Noodlez on May 25, 2004, 11:51 AM
Download SiSoft Sandra, it is free software that displays nearly everything about your computer.

Can you provide a link?  Their Website is hell to navigate through for me...

http://download.guru3d.com/sandra/

warz

Quote from: Mephisto on May 24, 2004, 10:31 PM
Recently I've been working on a program which actively updates your system's current information on Windows NT 4.0+.  I'm wondering though if anyone has used a program like this.  Typically a window that has a list of system informations like CPU usage, memory allocated, memory avaliable, page file, etc. etc. -- does anyone know of any free ones?  I'd like to get some ideas from them.  If one came with the source that'd be even better.  Thanks...

Just an example of what you might see in the window:

CPU Usage: 55%
Memory Avaliable: 403MB
Memory Used: 7021MB
Drive C Space: 4GB
IP: 63.241.83.7
etc.

The best one ever: gkrellm
Search for it, it's intense.

K

#27
Here's a quick example of what you can do using the System.Management assembly in .NET.


using System;
using System.Management;

namespace Monitor
{

   class ExampleClass
   {
      [STAThread]
      static void Main(string[] args)
      {
         PerformanceWatcher p = new PerformanceWatcher();
         p.UpdateAll();

         Console.WriteLine("CPU Usage: {0}%", p.GetCPUUsagePercent());
         Console.WriteLine("Free Memory: {0} MB -or- {1} KB -or- {2} Bytes", p.GetFreeMemMBytes(), p.GetFreeMemKBytes(), p.GetFreeMemBytes());
      }
   }

   class PerformanceWatcher
   {
      protected ManagementScope _msScope = new ManagementScope(ManagementPath.DefaultPath);
      protected ManagementObjectSearcher _mosSearch = new ManagementObjectSearcher();
      protected ManagementObjectCollection _mocCollection;
      protected ObjectQuery _oqCPUQuery = new ObjectQuery("SELECT PercentProcessorTime, TimeStamp_Sys100NS FROM Win32_PerfRawData_PerfOS_Processor where Name='_Total'");
      protected ObjectQuery _oqMemQuery = new ObjectQuery("SELECT AvailableMBytes, AvailableKBytes, AvailableBytes FROM Win32_PerfRawData_PerfOS_Memory");

      protected ulong _ulFreeMemMB = 0;
      protected ulong _ulFreeMemKB = 0;
      protected ulong _ulFreeMemB  = 0;
      protected double _dbCpuUsagePercent = 0;

      public PerformanceWatcher()
      {
         _msScope.Connect();
         _mosSearch.Scope = _msScope;
      }

      public void UpdateAll(int cpu_timing_ms)
      {
         UpdateFreeMem();
         UpdateCPUUsage(cpu_timing_ms);
      }
      public void UpdateAll()
      {
         UpdateFreeMem();
         UpdateCPUUsage();
      }

      public void UpdateCPUUsage()
      {
         UpdateCPUUsage(2000);
      }
      public void UpdateCPUUsage(int timing_ms)
      {
         _mosSearch.Query = _oqCPUQuery;
         _mocCollection = _mosSearch.Get();

         double n1 = 0, d1 = 0, n2 = 0, d2 = 0;
         foreach(ManagementObject m in _mocCollection)
         {
            n1 = (ulong)m["PercentProcessorTime"];
            d1 = (ulong)m["TimeStamp_Sys100NS"];
           break;
         }

         System.Threading.Thread.Sleep(timing_ms);

         _mocCollection = _mosSearch.Get();
         foreach(ManagementObject m in _mocCollection)
         {
            n2 = (ulong)m["PercentProcessorTime"];
            d2 = (ulong)m["TimeStamp_Sys100NS"];
           break;
         }

         _dbCpuUsagePercent = Math.Abs(Math.Round((1 - ((n2 - n1)/(d2 - d1)))*100, 2));
      }

      public void UpdateFreeMem()
      {
         _mosSearch.Query = _oqMemQuery;
         _mocCollection = _mosSearch.Get();

         foreach(ManagementObject m in _mocCollection)
         {
            _ulFreeMemMB = (ulong)m["AvailableMBytes"];
            _ulFreeMemKB = (ulong)m["AvailableKBytes"];
            _ulFreeMemB  = (ulong)m["AvailableBytes"];
           break;
         }
      }


      public double GetCPUUsagePercent()
      {
         return _dbCpuUsagePercent;
      }

      public ulong GetFreeMemMBytes()
      {
         return _ulFreeMemMB;
      }

      public ulong GetFreeMemKBytes()
      {
         return _ulFreeMemKB;
      }

      public ulong GetFreeMemBytes()
      {
         return _ulFreeMemB;
      }
   };
}

vile

#28
Don't worry, that's way beyond Mephisto (jk).