有没有 C++或 Qt 库可用于衡量应用程序的功能使用情况

发布于 2024-08-04 01:22:28 字数 108 浏览 5 评论 0原文

我希望能够测量我们的应用程序中正在使用的功能。 例如,某些窗口打开了多少,某些控件被单击了多少。 我可以想象一个工具可以测量这一点并将报告发送到网络服务器,该服务器可以进一步处理它以从中创建有意义的数据

I would like to be able to measure the features in our application that are being used.
For example how much certain windows are opened, certain controls are clicked.
I can imagine a tool that measures this and sends a report to a web server, that can further process it to create meaningful data from it

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

深海里的那抹蓝 2024-08-11 01:22:28

第一个问题:你应该这样做吗?人们不喜欢他们的软件在未经他们同意的情况下打电话回家。但假设他们对此表示同意:

这在技术上是可行的,有两种方法:自动或手动。当然,考虑到你的问题,我假设你正在使用Qt。

自动:

  • 为您想要跟踪的所有 QObject 指定一个正确的名称,
  • 在您的应用程序上安装事件过滤器以捕获所有 ChildEvent 关于创建和销毁的对象。
  • ChildEvent 中,您可以提取 对象的名称
  • 那么您就可以记录该对象的创建频率。您还可以利用这个机会向该特定对象添加事件侦听器,以便在该对象显示或隐藏时收到通知,或跟踪其他类型的使用情况
  • 将所有内容记录到日志文件中

手动:

  • 将日志语句添加到您的代码的相关部分想要追踪。

最终:

  • 定期发送日志文件

First question : should you do it ? People don't like when their software phones home without their consent. But assuming they are ok with it then:

It's technically possible, with two approaches: automatic or manual. Of course, given your question, I assume that you are using Qt.

Automatic:

  • give a proper name to all the QObject that you want to trace
  • install an event filter on your application to catch all the ChildEvent about objects that are created and destroyed.
  • from the ChildEvent, you can extract the object's name
  • then you can already log how often that object is created. You can also use the opportunity to add an event listener to that specific object, to be notified when it is shown or hidden or track other kind of usage
  • log everything to a log file

Manual :

  • add log statements to relevant part of your code that you want to track.

Final :

  • send the log file on a regular basis
无人接听 2024-08-11 01:22:28

我想,你的答案是“不”。我不认为有这样的图书馆。

我还认为,这里最好的解决方案是日志记录,这意味着您应该在主程序功能中手动引入一些日志功能并将日志文件发送回。当涉及到日志记录时,您可以考虑使用面向方面的编程(C++ 有这样的工具),它可以简化您的任务...

I guess, your answer is "No". I don't think there are such libraries.

I also think, the best solution here is logging, meaning you should manually introduce some log functions into your main program features and send back the log file. When it comes to logging, you may consider using aspect-oriented programming (and there are such tools for C++), it may simplify your task...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文