You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
2.2 KiB
52 lines
2.2 KiB
19 years ago
|
|
||
16 years ago
|
|
||
|
import de.anomic.http.httpRequestHeader;
|
||
17 years ago
|
import de.anomic.http.httpdByteCountInputStream;
|
||
|
import de.anomic.http.httpdByteCountOutputStream;
|
||
19 years ago
|
import de.anomic.plasma.plasmaSwitchboard;
|
||
17 years ago
|
import de.anomic.plasma.plasmaSwitchboardConstants;
|
||
17 years ago
|
import de.anomic.server.serverMemory;
|
||
19 years ago
|
import de.anomic.server.serverObjects;
|
||
17 years ago
|
import de.anomic.server.serverProcessor;
|
||
19 years ago
|
import de.anomic.server.serverSwitch;
|
||
|
|
||
|
public class status_p {
|
||
|
|
||
|
|
||
16 years ago
|
public static serverObjects respond(final httpRequestHeader header, final serverObjects post, final serverSwitch<?> env) {
|
||
19 years ago
|
// return variable that accumulates replacements
|
||
17 years ago
|
final plasmaSwitchboard sb = (plasmaSwitchboard) env;
|
||
|
final serverObjects prop = new serverObjects();
|
||
17 years ago
|
if (post == null || !post.containsKey("html"))
|
||
|
prop.setLocalized(false);
|
||
|
prop.put("rejected", "0");
|
||
17 years ago
|
sb.updateMySeed();
|
||
17 years ago
|
final int cacheOutSize = sb.webIndex.dhtOutCacheSize();
|
||
17 years ago
|
final long cacheMaxSize = sb.getConfigLong(plasmaSwitchboardConstants.WORDCACHE_MAX_COUNT, 10000);
|
||
17 years ago
|
prop.putNum("ppm", sb.currentPPM());
|
||
17 years ago
|
prop.putNum("qpm", sb.webIndex.seedDB.mySeed().getQPM());
|
||
|
prop.putNum("wordCacheSize", sb.webIndex.dhtOutCacheSize() + sb.webIndex.dhtInCacheSize());
|
||
17 years ago
|
prop.putNum("wordCacheWSize", cacheOutSize);
|
||
17 years ago
|
prop.putNum("wordCacheKSize", sb.webIndex.dhtInCacheSize());
|
||
17 years ago
|
prop.putNum("wordCacheMaxSize", cacheMaxSize);
|
||
|
prop.put("wordCacheWCount", cacheOutSize);
|
||
|
prop.put("wordCacheMaxCount", cacheMaxSize);
|
||
19 years ago
|
|
||
18 years ago
|
//
|
||
|
// memory usage and system attributes
|
||
17 years ago
|
prop.putNum("freeMemory", serverMemory.free());
|
||
|
prop.putNum("totalMemory", serverMemory.total());
|
||
|
prop.putNum("maxMemory", serverMemory.max());
|
||
17 years ago
|
prop.putNum("processors", serverProcessor.availableCPU);
|
||
18 years ago
|
|
||
|
// proxy traffic
|
||
|
prop.put("trafficIn", httpdByteCountInputStream.getGlobalCount());
|
||
18 years ago
|
prop.put("trafficProxy", httpdByteCountOutputStream.getAccountCount("PROXY"));
|
||
18 years ago
|
prop.put("trafficCrawler", httpdByteCountInputStream.getAccountCount("CRAWLER"));
|
||
|
|
||
19 years ago
|
// return rewrite properties
|
||
|
return prop;
|
||
|
}
|
||
|
|
||
|
}
|