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

add LockPostgreSQL and BenchmarkDistLockers #38

Closed
wants to merge 1 commit into from

Conversation

leeym
Copy link
Collaborator

@leeym leeym commented Mar 15, 2024

Add the following two

  • LockPostgreSQL implements DistLocker using advisory locks in PostgreSQL
  • BenchmarkDistLockers to compare the performance for distributed lockers
goos: darwin
goarch: amd64
pkg: github.com/mennanov/limiters
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
BenchmarkDistLockers
2024/03/15 12:55:40 Connected to 127.0.0.1:2181
2024/03/15 12:55:40 authenticated: id=72058590880071686, timeout=4000
2024/03/15 12:55:40 re-submitting `0` credentials after reconnect
BenchmarkDistLockers/LockPostgreSQL
BenchmarkDistLockers/LockPostgreSQL-12               626           1616118 ns/op
BenchmarkDistLockers/LockEtcd
BenchmarkDistLockers/LockEtcd-12                     177           6754712 ns/op
BenchmarkDistLockers/LockConsul
BenchmarkDistLockers/LockConsul-12                   121           9367934 ns/op
BenchmarkDistLockers/LockZookeeper
BenchmarkDistLockers/LockZookeeper-12                288           4256412 ns/op
BenchmarkDistLockers/LockRedis
BenchmarkDistLockers/LockRedis-12                   1292            928732 ns/op
BenchmarkDistLockers/LockMemcached
BenchmarkDistLockers/LockMemcached-12                716           1639791 ns/op
PASS
ok      github.com/mennanov/limiters    266.516s

It will be easier to review in unified view and hide whitespace.

Copy link

codecov bot commented Mar 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.01%. Comparing base (c1474e1) to head (1cb64ea).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #38      +/-   ##
==========================================
+ Coverage   79.90%   80.01%   +0.11%     
==========================================
  Files          12       12              
  Lines        1438     1446       +8     
==========================================
+ Hits         1149     1157       +8     
  Misses        212      212              
  Partials       77       77              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@leeym leeym force-pushed the add-LockPostgreSQL branch 2 times, most recently from 5c06c99 to 52e5fb6 Compare March 15, 2024 21:59
@leeym leeym force-pushed the add-LockPostgreSQL branch from 52e5fb6 to 1cb64ea Compare March 15, 2024 23:23
@leeym
Copy link
Collaborator Author

leeym commented Mar 16, 2024

It is flaky and doesn't work as expected.

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.

1 participant