OpenVZ Forum


Home » General » Support » Where can we download the "vzstat" source code?
Re: Where can we download the "vzstat" source code? [message #2771 is a reply to message #2770] Thu, 20 April 2006 06:03 Go to previous messageGo to previous message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

From: *sw.ru
You can use /proc/vz/vestat file:
[root@tst ~]# cat /proc/vz/vestat
Version: 2.2
      VEID       user       nice     system     uptime                 idle                 strv               uptime                 used               maxlat               totlat   numsched
       100          0          0       5063   40598698       70123626936598                    0       35069066535737           8612439976                 2314            737714316      53144


in this file for each VPS you have:
1. "user nice system uptime" in jiffies. i.e. divide by jiffies_per_second to get seconds (see below).
2. "idle strv uptime used" in cycles. much more accurate. seconds = used / cycles_per_jiffy / jiffies_per_seconds.
3. values of cycles_per_jiffy and jiffies_per_seconds can be read from /proc/vz/stats

BTW, while looking into this I found a small misprint in /proc/vz/vestat output code, so thank you very much Smile

--- ./kernel/vecalls.c.usertm	2006-04-07 19:04:46.000000000 +0400
+++ ./kernel/vecalls.c	2006-04-20 10:05:24.000000000 +0400
@@ -2875,7 +2875,7 @@ static int vestat_seq_show(struct seq_fi
 	idle_time = strv_time = used = 0;
 
 	for (cpu = 0; cpu < NR_CPUS; cpu++) {
-		user_ve += VE_CPU_STATS(ve, cpu)->nice;
+		user_ve += VE_CPU_STATS(ve, cpu)->user;
 		nice_ve += VE_CPU_STATS(ve, cpu)->nice;
 		system_ve += VE_CPU_STATS(ve, cpu)->system;
 		used += VE_CPU_STATS(ve, cpu)->used_time;



http://static.openvz.org/userbars/openvz-developer.png
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: CanĀ“t access the created VE
Next Topic: privvmpages are failing even if barrier and limit are high enough
Goto Forum:
  


Current Time: Fri May 24 14:49:53 GMT 2019