有没有收集 Win32 应用程序使用统计信息的工具?
有什么工具可以做到这一点吗? 就像一个网站一样,出于相同的基本原因?
更新 - - 我的意思是收集有关我正在编写的应用程序的统计信息 我需要知道哪些选项最常用、何时、次数等。
Is there any tool that can do this? Just like a website and for the same basic reasons?
UPDATE ---
I mean collecting statistics info about an application that I am writing
I need to know what options are used most, when, times, etc.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我过去也做过类似的事情。
我可以想到两种方法来做到这一点。
使用操作:
使用操作时,通过将代码放置在 TActionList.OnExecute 处理程序中可以非常轻松地跟踪 UI 使用情况。 此事件在执行单个操作之前触发,这使您可以跟踪发生的情况和时间。
例如:
不使用操作:
如果您不使用操作,事情会变得有点困难,但并非不可能。 您必须创建一个带有 TMenuItem 后代的新单元,其中包含您的日志记录代码。 确保将新单元放在使用它的每个单元的使用子句中的 MENU 单元之后。 新的后代必须被称为 TMenuItem 才能工作。 因为您本质上是重新引入相同的类,但具有扩展的功能。
这是我整理的一个快速单元,展示了一个非常简单的示例。
要使用上述单元,请将其作为带有要跟踪的菜单(TMainMenu 或 TPopupMenu)的任何表单/DataModule 的使用子句中的最后一个单元。 如果您不想跟踪特定单位,请不要包含它。
这两种方法很简单,虽然它们确实有效,但可能不是最好的解决方案。
I've done something like this in the past.
There are two ways that I can think of to do this.
With Actions:
When using actions it's very easy to follow the UI usage by placing code in the TActionList.OnExecute handler. This event fires off before the individual action executes which allows for you to trace what has happened and when.
For Example:
Without Actions:
If your not using Actions it becomes a little more difficult but not impossible. You create have to create a new unit with a TMenuItem descendant with your logging code in it. Make sure to place your new unit after the MENU unit in the uses clause in every unit that makes use of it. The new descendant has to be called TMenuItem for this to work. Since your essentially reintroducing the same class but with extended functionality.
Here is a quick unit I threw together showing a very simple example.
To use the above unit place it as the last unit in the uses clause of any form/DataModule with menus (TMainMenu or TPopupMenu) that you want to trace. If you don't want to trace a particular unit don't include it.
These two methods are simple and while they do work they probably are not the best solutions.
我假设您正在谈论 Windows 性能计数器
看看这个 链接
使用 Windows 系统监视器 (SYSMON) 查看结果,
请查看此 链接
还有教授的性能监控组件对于德尔福
I assume you are talking about the windows performance counters
Have a look at this link
Use the Windows System Monitor (SYSMON) to see the result
have a look at this link
There is also Prof's Performance Monitoring Components for delphi
您需要一些覆盖率分析工具吗?
Do you need some coverage analysis tool?