umami icon indicating copy to clipboard operation
umami copied to clipboard

use ws for statistics

Open wx-11 opened this issue 1 year ago • 1 comments

Describe the feature or enhancement

Hi I noticed that the rules for web users online are not real time. I don't know much about programming and asked gpt to find out if you guys are rotating? I only noticed that the data would be logged via send post, but would that be less accurate? In my single user local site test, I noticed that when I close the page the number of people online1 still persists.

I think using WebSocket and a backend link should be more accurate, don't you think? Of course the performance requirements will be a bit higher, but I think with the mysql database, using ws shouldn't be too much of a problem and will be more accurate. send post data can be used as a first time entry to the webpage to get web client information such as ua. I think it would be more appropriate to use ws to keep online statistics and average usage etc.

Of course I know it's definitely not due to technical limitations, do you guys have any concerns or historical reasons for not using ws? I didn't find a related issue only one issue with stats not working properly linked through ws https://github.com/umami-software/umami/issues/1149 I was hoping to look into using ws to make the stats more accurate, or is it possible that I'm misunderstanding and ws shouldn't be used here? no I don't know if this kind of issue meets your requirements, if there is a problem with the format, you can just close the issue.

Regardless of whether ws is considered or not, I think this is a great tool. I like this project a lot. Thank you guys for developing and contributing.

Translated with DeepL.com (free version)

你好 我注意到 网页用户在线的规则并不是实时的。我不太懂编程,问了一下gpt才知道你们是轮训的吗?我只注意到会通过send post来记录数据,但是这样会不会不太准确?在我单用户本地网站测试的时候,发现我关闭了网页 在线人数1还是会一直持续。

我认为使用WebSocket和后端链接 应该会更精准 你觉得呢?当然可能性能方面要求会稍微高一点,但是我想都使用了mysql数据库了,使用ws应该也不会造成太大问题,反而会更精准。send的post数据可以当做第一次进入网页时的做法,用于获取ua等网页客户端信息。后续保持在线统计和平均使用等等,我觉得使用ws会更加合适。

当然我知道这绝对不是因为技术限制,你们不使用ws是有什么顾虑或者历史性原因吗?我没找到相关的issue 只有一个通过ws链接的统计不正常的问题 https://github.com/umami-software/umami/issues/1149。我希望可以考虑一下使用ws来使数据统计更加精准,还是有可能是我理解错了,这里不应该使用ws?不知道这样的issue符不符合你们的要求,如果格式有问题,可以直接关闭issue。

无论是否考虑ws,我都觉得这个工具很不错。我很喜欢这个项目。谢谢你们的开发和贡献。

wx-11 avatar Jun 08 '24 17:06 wx-11

Also, I've noticed a small problem that may not be a problem.

If I move the ownership of a website from an individual to a team. Then the previous personal link website/id can still be accessed from the status of the page that was moved to the team team/id. I haven't looked into it to see if it's because the team members have access to the page that they can continue to access it using a URL that the interface can't generate. If this is not the case, does it mean that users can access each other's web page stats as long as they know the id?

Translated with DeepL.com (free version)

另外 我注意到一个小问题 可能算不上问题

我如果把网站的所有权 从个人移入到团队。那么之前的个人链接website/id 还可以继续访问到这个移入到团队 team/id 的网页状态。我没有仔细研究是不是因为团队成员拥有这个网页的访问权所以可以使用界面无法生成的网址继续访问。如果不是这样,是否意味着只要知道了id,用户就可以互相访问网页的统计?

wx-11 avatar Jun 08 '24 17:06 wx-11

This issue is stale because it has been open for 60 days with no activity.

github-actions[bot] avatar Aug 08 '24 01:08 github-actions[bot]

This issue was closed because it has been inactive for 7 days since being marked as stale.

github-actions[bot] avatar Aug 16 '24 01:08 github-actions[bot]