Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/statistic #11

Merged
merged 12 commits into from
Nov 22, 2024
Merged

Feat/statistic #11

merged 12 commits into from
Nov 22, 2024

Conversation

Ayanami1314
Copy link
Contributor

目前只是一个简单的框架, 只统计了UV/PV
只有基础的测试
现在还没有做存DB的部分,中间件也没有并入router,所以对原来的代码没有影响
仅是review用pr

@Ayanami1314 Ayanami1314 requested a review from dujiajun November 9, 2024 16:51
@Ayanami1314
Copy link
Contributor Author

相关代码都在middleware/statistic.go 和middleware/statistic_test.go

@dujiajun
Copy link
Contributor

和这个需求本身无关的代码有点多啊,要不重新从main切出来,不然diff看着累

middleware/statistic.go Outdated Show resolved Hide resolved
middleware/statistic.go Outdated Show resolved Hide resolved
middleware/statistic.go Outdated Show resolved Hide resolved
middleware/statistic.go Outdated Show resolved Hide resolved
middleware/statistic.go Show resolved Hide resolved
@Ayanami1314
Copy link
Contributor Author

merge了main

@dujiajun
Copy link
Contributor

再补下落表和生成报表的部分吧。我想要一个类似 discourse 的看板,日uv/pv,7天内,30天内,日活/月活比例等。

…re v1. Test Added. Bug Fixed

Feature:
1. statistic middleware and task are main changes. Can get user, review, course daily adds
and total counts and UV, PV, DAU, WAU, MAU efficiently.
2. save statistic data and statistic counts to db
3. add basic tests of statistics.
4. build simple test framewark for statistic, refactor the middleware
5. fix some previous bug on repository
@Ayanami1314
Copy link
Contributor Author

Ayanami1314 commented Nov 14, 2024

写了一个比较完整的版本
目前对基础的存库等做了测试
但没有定时任务测试

@Ayanami1314 Ayanami1314 requested a review from dujiajun November 14, 2024 16:41
@dujiajun
Copy link
Contributor

没来得及细看,代码里的 magic number 都处理一下,我记得 golang 的 times 包里有常量定义

handler/statistic.go Outdated Show resolved Hide resolved
model/model/statistic.go Outdated Show resolved Hide resolved
model/model/statistic.go Outdated Show resolved Hide resolved
model/po/statistic.go Outdated Show resolved Hide resolved
service/statistic.go Outdated Show resolved Hide resolved
task/statistic.go Outdated Show resolved Hide resolved
util/timeutil.go Outdated Show resolved Hide resolved
(lack enough test for queue and full-chain api)
1. refactor task queue with asynq serveMux and Scheduler
2. refactor statistic related api
3. get timezone from env(see timeutil.go)
@Ayanami1314 Ayanami1314 requested a review from dujiajun November 20, 2024 07:27
@Ayanami1314 Ayanami1314 mentioned this pull request Nov 20, 2024
model/po/statistic.go Outdated Show resolved Hide resolved
middleware/statistic.go Show resolved Hide resolved
@dujiajun
Copy link
Contributor

其他应该没啥问题了

@Ayanami1314
Copy link
Contributor Author

那个llm相关的问题我建了一个fix 分支pr了,那个分支是在main上建的,是在那里合了还是在这个分支合

change the GetPeriodInfoFromPOs method. add basic tests.
@dujiajun
Copy link
Contributor

另外起一个pr没问题,在那边合吧

@Ayanami1314
Copy link
Contributor Author

现在model和po的Date都是yyyy-mm-dd
dto依然是传时间戳int64作为时间范围

@dujiajun dujiajun merged commit e35ad84 into main Nov 22, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants