The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Average completion time calculation? Seawall UNIX for Dummies Questions & Answers 5 05-20-2008 06:13 AM
Generating files with time interval of fifteen minutes aajan Shell Programming and Scripting 0 09-25-2007 01:54 AM
script execution time calculation johnsonbryce Shell Programming and Scripting 9 02-25-2006 01:33 AM
time calculation liux99 UNIX for Advanced & Expert Users 2 08-18-2005 10:33 PM
Time Wait interval eloquent99 SUN Solaris 1 12-05-2003 09:56 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-14-2006
Rakesh Ranjan's Avatar
Rakesh Ranjan Rakesh Ranjan is offline
Registered User
  
 

Join Date: Aug 2005
Location: India
Posts: 42
change time interval for average load calculation

Hi friends, I need to find average load on my server. The problem would have been quite simple had I required the load averaged over 1 min,5 min or 15 min which I can easily find reading /proc/loadavg (the same as shown by 'uptime') but my requirement compels me to find load averaged over 10 sec or 20 sec.

I went through the linux source code (esp. linux/include/linux/sched.h, linux/fs/proc/proc_misc.c, linux/kernel/timer.c) these gave me an idea that may be changing EXP_1, EXP_5, EXP_15 might help my case but I want to be sure if I'm thinking is right also I want to be careful that I don't effect other things.
Thanks for any help.

Last edited by Rakesh Ranjan; 04-14-2006 at 03:14 PM.. Reason: calculation mistake corrected
  #2 (permalink)  
Old 05-04-2006
lunc
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
Hi!

As I understand you works under Linux, am I right?
If so, as you can see EXP_1, for example, is 1/e(5/60)*FIXED_1, where 60 is a one munute and 5 AFAIK is a frequency of calculation.

So I think you need 1/e(5/20)*FIXED_1 for a load averaged over 20 seonds.
  #3 (permalink)  
Old 05-12-2006
Rakesh Ranjan's Avatar
Rakesh Ranjan Rakesh Ranjan is offline
Registered User
  
 

Join Date: Aug 2005
Location: India
Posts: 42
A rather simple calculation that I too arrived at. But my problem was that whether it would otherthings (since this file is included in many files like timer.c I thought it might affect scheduling etc. and that might create problem).
But now I've tested it out everthing seems normal (doesn't make my system go awry).

Still thanks fro ur help
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:37 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0