简体   繁体   English

测量与数据库有关的网站经过时间

[英]Measure elapsed time of Website relating to database

I need to measure the time elapsed between requesting data from a database and the moment the data are visualized. 我需要测量从数据库请求数据到可视化数据之间经过的时间。

I'm working with a webclient which is relating to a big database. 我正在与一个与大型数据库有关的Web客户端一起工作。 When creating a report (as pdf document) the webclient will access the database. 创建报告(作为pdf文档)时,Web客户端将访问数据库。 While accessing and calculating the needed data for the report, the pdf document already opens in a new page in the web browser and shows 'about:blank' as URL and 'waiting for ...' (... = relating the place it's waiting for). 在访问和计算报告所需的数据时,pdf文档已经在Web浏览器的新页面中打开,并显示“ about:blank”作为URL和“ waiting ...”(... =关联它的位置)等待)。 I actually need the time elapsed from the 'waiting for ...'. 我实际上需要从“等待...”开始经过的时间。

My idea is to measure the time, from the moment the new window for the pdf document opens until the end of 'about:blank', by simply using: 我的想法是通过简单地使用以下方法测量从pdf文档的新窗口打开到'about:blank'结束之间的时间。

long lStartTime = System.currentTimeMillis();

//task that identifies the opening of webpage til end of 'about:blank'

long lEndTime = System.currentTimeMillis();

long difference = lEndTime - lStartTime;

System.out.println("Elapsed time: " + difference); 

The problem is, I don't know how to implement the task as described above. 问题是,我不知道如何实现上述任务。 Is there anybody with a similar problem or has an idea how to implement the code? 是否有人遇到类似问题或对如何实现代码有想法?

I appreciate every help. 感谢您的帮助。 I'm not very used to programming, but I do have some basic skills. 我不太习惯编程,但是我确实有一些基本技能。

Thanks in advance! 提前致谢!

I assume that you need to measure this time for troubleshooting performance issues. 我认为您需要测量这次时间来解决性能问题。 In this case you can use existing solutions for profiling. 在这种情况下,您可以使用现有的解决方案进行性能分析。

For example you can use Sniffy - it will measure the time spent for executing the SQL Query and will return it as HTTP header as well as on the web page itself 例如,您可以使用Sniffy-它会测量执行SQL查询所花费的时间,并将其作为HTTP标头以及在网页本身上返回

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM