/*
- * $Id: protos.h,v 1.239 1998/07/22 21:08:11 wessels Exp $
+ * $Id: protos.h,v 1.240 1998/07/22 21:24:41 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
extern double median_svc_get(int, int);
extern void pconnHistCount(int, int);
extern int stat5minClientRequests(void);
+extern double stat5minCPUUsage(void);
+
/* StatHist */
/*
- * $Id: stat.cc,v 1.265 1998/07/22 21:07:37 wessels Exp $
+ * $Id: stat.cc,v 1.266 1998/07/22 21:24:42 wessels Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
storeAppendPrintf(sentry, "\tCPU Time:\t%.3f seconds\n", cputime);
storeAppendPrintf(sentry, "\tCPU Usage:\t%.2f%%\n",
dpercent(cputime, runtime));
+ storeAppendPrintf(sentry, "\tCPU Usage, 5 minute avg:\t%.2f%%\n",
+ stat5minCPUUsage());
storeAppendPrintf(sentry, "\tMaximum Resident Size: %d KB\n",
rusage_maxrss(&rusage));
storeAppendPrintf(sentry, "\tPage faults with physical i/o: %d\n",
#endif /* HAVE_EXT_MALLINFO */
#endif /* HAVE_MALLINFO */
storeAppendPrintf(sentry, "Memory accounted for:\n");
- storeAppendPrintf(sentry, "\tTotal accounted: %6d KB %d%%\n",
- memTotalAllocated());
+ storeAppendPrintf(sentry, "\tTotal accounted: %6d KB\n",
+ memTotalAllocated()>>10);
storeAppendPrintf(sentry, "File descriptor usage for %s:\n", appname);
storeAppendPrintf(sentry, "\tMaximum number of file descriptors: %4d\n",
storeAppendPrintf(sentry, "cpu_usage = %f%%\n", dpercent(ct, dt));
}
+
void
statInit(void)
{
return Counter.client_http.requests - CountHist[5].client_http.requests;
}
+double
+stat5minCPUUsage(void)
+{
+ return dpercent(CountHist[0].cputime - CountHist[5].cputime,
+ tvSubDsec(CountHist[5].timestamp, CountHist[0].timestamp));
+}
#if STAT_GRAPHS
/*