|
From: <ian...@us...> - 2008-01-26 01:18:45
|
Revision: 690
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=690&view=rev
Author: iansmith
Date: 2008-01-25 17:18:49 -0800 (Fri, 25 Jan 2008)
Log Message:
-----------
Added brief mode to the status servlet. Other load-management tools use this to get a machine readable version of status.
Modified Paths:
--------------
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/StatusServlet.java
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/StatusServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/StatusServlet.java 2008-01-23 03:18:47 UTC (rev 689)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/StatusServlet.java 2008-01-26 01:18:49 UTC (rev 690)
@@ -6,7 +6,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
-import java.net.URI;
import java.net.URL;
import java.sql.Time;
import java.util.ArrayList;
@@ -25,7 +24,6 @@
import com.ogoglio.persist.SimPersistTasks;
import com.ogoglio.persist.SimRecord;
import com.ogoglio.util.Log;
-import com.ogoglio.util.NetworkUtils;
import com.ogoglio.util.StreamUtils;
public class StatusServlet extends OgoglioServletBase {
@@ -196,6 +194,16 @@
response.setStatus(HttpServletResponse.SC_OK);
return;
}
+
+ if (request.getParameter("brief")!=null) {
+ StatusData sd=computeCurrentStatus();
+ addSpaceInfo(sd);
+ StringBuffer buffer=new StringBuffer();
+ buffer.append(""+sd.load_1min+","+sd.simCount+","+sd.userCount);
+ sendStringResponse(buffer.toString(), "text/plain", response);
+ response.setStatus(HttpServletResponse.SC_OK);
+ return;
+ }
try {
StatusData data = computeCurrentStatus();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|