We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://github.com/hiberabyss/JustDoIt/blob/master/QPSstatic/QPS_static.go#L30-L39
counter.Timestamp 这个封装个setter方法
counter.Timestamp
counter.CountPerSecond 这个封装个setter、getter方法, 在方法里加锁,这里粒度应该更小吧。
counter.CountPerSecond
The text was updated successfully, but these errors were encountered:
Hi @barryz ,
这个实现中并没有太多的考虑性能方面的问题, 后续可以做一些改进, 也欢迎提交 Pull Request :)
感觉优化 ticker 里锁部分的代码意义不大, 毕竟一秒才执行一次. 不过倒是可以考虑用两个锁来分别操作 CountQPS 和 CountAll .
Sorry, something went wrong.
No branches or pull requests
https://github.com/hiberabyss/JustDoIt/blob/master/QPSstatic/QPS_static.go#L30-L39
counter.Timestamp
这个封装个setter方法counter.CountPerSecond
这个封装个setter、getter方法, 在方法里加锁,这里粒度应该更小吧。The text was updated successfully, but these errors were encountered: