Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/perebaj/metrica
Studies about the most basically race condition problem: Concurrent Counter
https://github.com/perebaj/metrica
concurrency golang race-conditions
Last synced: about 6 hours ago
JSON representation
Studies about the most basically race condition problem: Concurrent Counter
- Host: GitHub
- URL: https://github.com/perebaj/metrica
- Owner: perebaj
- Created: 2023-10-10T15:05:28.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-12T15:12:52.000Z (about 1 year ago)
- Last Synced: 2024-06-21T02:06:08.978Z (5 months ago)
- Topics: concurrency, golang, race-conditions
- Language: Go
- Homepage:
- Size: 1.67 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# metrica
What we are trying to solve here? A simple race condition problem, where multiple pieces of code are trying to access the same shared data!
![image](assets/metrica.png)
## Get starting
All commands could be accessed typing: `make help`
To test the code using containers🐋
`make dev/test` & `make dev/lint`
## LoadTest
The load tests it's using the following rules:
- 100 concurrent users
- 10000 requests in total![image](assets/loadtest.png)
## Resources
Some resources that were useful to solve it
- [Mutex](https://golangbot.com/mutex/)
- [Atomic Counters](https://gobyexample.com/atomic-counters)
- [Bjorn Rabenstein - Prometheus: Designing and Implementing a Modern Monitoring Solution in Go](https://www.youtube.com/watch?v=1V7eJ0jN8-E)
- [go file mutex](https://echorand.me/posts/go-file-mutex/)