summaryrefslogtreecommitdiff
path: root/src/server_status.cc
diff options
context:
space:
mode:
authordeva <deva>2005-06-19 11:44:14 +0000
committerdeva <deva>2005-06-19 11:44:14 +0000
commit52fd913be8b044f1d064973c53b4467e5bd153fe (patch)
tree807ac3d85c9af0fe81bd88c22f6fe32c3c7af25b /src/server_status.cc
parent60053525996c751ea9cdeddebbea8fa98e0c23a3 (diff)
Cleaned up a log of logging.
Fixed server queue (shouldn't happen). Added user and group lookup.
Diffstat (limited to 'src/server_status.cc')
-rw-r--r--src/server_status.cc33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/server_status.cc b/src/server_status.cc
index 23c6c3d..e65cef2 100644
--- a/src/server_status.cc
+++ b/src/server_status.cc
@@ -31,6 +31,11 @@
/*
* $Log$
+ * Revision 1.9 2005/06/19 11:44:14 deva
+ * Cleaned up a log of logging.
+ * Fixed server queue (shouldn't happen).
+ * Added user and group lookup.
+ *
* Revision 1.8 2005/05/22 15:49:22 deva
* Added multithreaded encoding support.
*
@@ -38,16 +43,13 @@
* Fixed file rights (All read on files and directories, and all execute on directories).
*
* Revision 1.6 2005/05/16 16:00:57 deva
- *
* Lots of stuff!
*
* Revision 1.5 2005/05/16 13:25:52 deva
- *
* Moved video setting to configuration file.
* Fine tuned setting for 2.4ghz server
*
* Revision 1.4 2005/05/09 16:40:20 deva
- *
* Added optimize yuv conversion code
*
* Revision 1.3 2005/05/03 08:31:59 deva
@@ -62,16 +64,19 @@
#include <stdio.h>
-#define UPD 25
-ServerStatus::ServerStatus()
+ServerStatus::ServerStatus(Info *i)
{
+ info = i;
+
gettimeofday(&oldtime, NULL);
for(int cnt = 0; cnt < BUFFERSIZE; cnt++) {
- frametime[cnt] = 41660 * UPD;
+ frametime[cnt] = 41660;
}
gettimeofday(&time, NULL);
+
+ frame = 0;
}
ServerStatus::~ServerStatus()
@@ -80,11 +85,6 @@ ServerStatus::~ServerStatus()
void ServerStatus::checkPoint()
{
- return;
-
- static int frame = 0;
- frame++;
- if(frame % UPD != 0) return;
for(int cnt = BUFFERSIZE - 1; cnt > 0; cnt--) {
frametime[cnt] = frametime[cnt-1];
}
@@ -95,11 +95,14 @@ void ServerStatus::checkPoint()
gettimeofday(&time, NULL);
- double total = 0.0;
- for(int cnt = 0; cnt < BUFFERSIZE; cnt++) {
- total += (double)frametime[cnt];
+ frame++;
+ if(frame % UPD == 0) {
+ double total = 0.0;
+ for(int cnt = 0; cnt < BUFFERSIZE; cnt++) {
+ total += (double)frametime[cnt];
+ }
+ info->info("Status - fps: %f", 1000000.0 / (total / (double)BUFFERSIZE));
}
- fprintf(stderr, "[ms: %d, fps: %f]\n", frametime[0] / UPD, (1000000.0 / (total / (double)BUFFERSIZE)) * UPD );
}