目前我做的是一个网站统计模块 具体的技术实现是
1 使用JS做来捕获网站的点击率
2 在页面中嵌入该JS代码。
3 JS将页面的请求派发给一个servlet请求对像 , 由该Servlet对像来对请求做出响应
4 servlet将页面请求中的数据存入缓存中
5 一个定时任务将在每隔一断时间后将缓存中的数据存入数据库中,再实现清缓存的功能(没有做同步)
我不知道这样做是否合理: 现在最重要的一个问题是:
我现在做了一个压力测试, 1 每隔十毫秒请求一次 。 2 同时打开十个这样的测试页面
现在问题出来了: 请求被阻塞了!! 请教各位大侠: 小弟这样做是否有哪个环节出错了?
1 使用JS做来捕获网站的点击率
2 在页面中嵌入该JS代码。
3 JS将页面的请求派发给一个servlet请求对像 , 由该Servlet对像来对请求做出响应
4 servlet将页面请求中的数据存入缓存中
5 一个定时任务将在每隔一断时间后将缓存中的数据存入数据库中,再实现清缓存的功能(没有做同步)
我不知道这样做是否合理: 现在最重要的一个问题是:
我现在做了一个压力测试, 1 每隔十毫秒请求一次 。 2 同时打开十个这样的测试页面
现在问题出来了: 请求被阻塞了!! 请教各位大侠: 小弟这样做是否有哪个环节出错了?
解决方案 »
- s2sh 整合之后 action之间传参数失败
- 求一嵌在JSP页面中的日历,日历要有记事功能。
- javascript问题
- 如何遍历XML树,取出其中的text内容。公司交给的任务,急啊!要不然就失业了!(在线等待)
- 用jsp+javaBean写的程序,前台表单添加数据到sqlserver数据库,怎么防止Null的问题
- google suggest问题
- cookie.setPath("/") 是什么意思? 有什么作用??
- 数据库连接问题,出现错误,高手帮忙
- 关于论坛字数的问题
- Java web在MVC模式下,怎样设计作为控制器的Controller才能使得它不那么臃肿庞大?
- 关于struts中html:select 出现Cannot find bean: "list" in any scope的问题.
- 莫名其妙的空指针问题???
测试浏览器是 Firefox:
使用的一个js函数
<script language="JavaScript">
setInterval("recordSoft(2,12700,3,1)",10);
</script>
每隔十毫秒向服务器发一次请求:并且同时打开十个页面:
请问下这个测试方法是否有问题!
document.write('<div style="display:none"><img id="pv_img" width="1" height="1" /></div>');function web(){
this.ip;
this.url=window.location;
this.source=0;
this.action=0;
this.resId;
this.resType=0;
this.page="http://192.168.1.112/count/count/webFilter.jsp";
}function soft(){
this.ip;
this.url=window.location;
this.userId=0;
this.source=0;
this.action=0;
this.resId;
this.resType=0;
this.page="http://192.168.1.112/count/count/softFilter.jsp";
}function getWebUrl(record){
var sUrl = record.page+"?a=1";
sUrl += "&url="+record.url;
sUrl += "&source="+record.source;
sUrl += "&action="+record.action;
sUrl += "&resId="+record.resId;
sUrl += "&resType="+record.resType;
return unescape(sUrl);
}function getSoftUrl(record){
var sUrl = record.page+"?a=1";
sUrl += "&url="+record.url;
sUrl += "&source="+record.source;
sUrl += "&action="+record.action;
sUrl += "&resId="+record.resId;
sUrl += "&resType="+record.resType;
return unescape(sUrl);
}function recordWeb(action,resId,resType,source){
//alert('--');
var record = new web();
record.source=source;
record.action=action;
record.resId=resId;
record.resType=resType;
//alert(getWebUrl(record));
document.getElementById("pv_img").src=getWebUrl(record);
}function recordSoft(action,resId,resType,source){
//alert('--');
var record = new soft();
record.source=source;
record.action=action;
record.resId=resId;
record.resType=resType;
//alert(getSoftUrl(record));
document.getElementById("pv_img").src=getSoftUrl(record);
}
function test(){
//document.getElementById("pv_img").src = "http://192.168.1.104/72xuanCount/count/test.jsp";
}我测试调用的页面代码如下:
<script language="JavaScript">
setInterval("recordSoft(2,12700,3,1)",10);
</script>我对AJAX不太熟悉! 请你看下我这样测试的话会不会有问题?