简体   繁体   English

以编程方式控制TPTP配置文件

[英]Control TPTP profiling programmatically

I need to profile a server-client Java application (based on Jersey/REST FYI). 我需要分析服务器-客户端Java应用程序(基于Jersey / REST FYI)。

I have learned around that profiling remote servers is a real pain with TPTP, so I want to keep it simple : I have written a test case (a "main") that runs a standalone server (Grizzly) and a client (within a separate thread) and process some load tests. 我了解到,配置远程服务器是TPTP的真正难题,所以我想保持简单:我编写了一个测试用例(一个“主”),它运行一个独立的服务器(Grizzly)和一个客户端(在单独的内部)线程)并处理一些负载测试。

I can run it in profiling mode (with Eclipse/TPTP), but I would like to isolate my core methods from all the noise of the server and client setup. 我可以在概要分析模式下(使用Eclipse / TPTP)运行它,但是我想将我的核心方法与服务器和客户机设置的所有干扰隔离开来。

I there a mean to programmatically enable / disable the TPTP profiling in my code, at some check points? 我是否有办法在某些检查点以编程方式启用/禁用代码中的TPTP配置文件?

I would recommend using Netbeans for profiling your app, irrespective if you're using it for development. 无论您是否将其用于开发,我都建议使用Netbeans对应用程序进行性能分析。 It can filter by package, class, or method so you only see what you want, as well as having nifty profiling points (things like stopwatches but way more powerful). 它可以按包,类或方法进行筛选,以便您仅查看所需内容,并具有漂亮的分析点 (诸如秒表之类的东西,但功能更强大)。 You can do things like: 您可以执行以下操作:

替代文字替代文字

Sorry for all the screenshots, but IMHO they help people who have never profiled before and are wondering what it can do for them. 对不起所有屏幕截图,但是恕我直言,它们可以帮助从未进行过配置的人,并且想知道它可以为他们做些什么。

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

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