Skip to content

Commit

Permalink
Merge pull request #56 from mingkhuang/master
Browse files Browse the repository at this point in the history
fix some typos
  • Loading branch information
platinummonkey committed May 7, 2021
2 parents f44c8fc + f3f7a54 commit 875d77d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions limit/aimd.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ type AIMDLimit struct {
mu sync.RWMutex
}

// NewDefaultAIMLimit will create a default AIMDLimit.
func NewDefaultAIMLimit(
// NewDefaultAIMDLimit will create a default AIMDLimit.
func NewDefaultAIMDLimit(
name string,
registry core.MetricRegistry,
tags ...string,
Expand Down
2 changes: 1 addition & 1 deletion limit/aimd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func TestAIMDLimit(t *testing.T) {
t.Run("DefaultAIMD", func(t2 *testing.T) {
t2.Parallel()
asrt := assert.New(t2)
l := NewDefaultAIMLimit("test", nil)
l := NewDefaultAIMDLimit("test", nil)
asrt.Equal(10, l.EstimatedLimit())
})

Expand Down
4 changes: 2 additions & 2 deletions limit/windowed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestWindowedLimit(t *testing.T) {
t.Run("DecreaseOnDrops", func(t2 *testing.T) {
t2.Parallel()
asrt := assert.New(t2)
delegate := NewDefaultAIMLimit("test", nil)
delegate := NewDefaultAIMDLimit("test", nil)
minWindowTime := (time.Millisecond * 100).Nanoseconds()
l, err := NewWindowedLimit("test", minWindowTime, minWindowTime*2, 10, 10, delegate, nil)
asrt.NoError(err)
Expand All @@ -50,7 +50,7 @@ func TestWindowedLimit(t *testing.T) {
t.Run("IncreaseOnSuccess", func(t2 *testing.T) {
t2.Parallel()
asrt := assert.New(t2)
delegate := NewDefaultAIMLimit("test", nil)
delegate := NewDefaultAIMDLimit("test", nil)
minWindowTime := (time.Millisecond * 100).Nanoseconds()
l, err := NewWindowedLimit("test", minWindowTime, minWindowTime*2, 10, 10, delegate, nil)
asrt.NoError(err)
Expand Down
2 changes: 1 addition & 1 deletion limiter/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
const (
defaultMinWindowTime = int64(1e9) // (1 s) nanoseconds
defaultMaxWindowTime = int64(1e9) // (1 s) nanoseconds
defaultMinRTTThreshold = int64(1e5) // (100 ms) nanoseconds
defaultMinRTTThreshold = int64(1e5) // (100 µs) nanoseconds
defaultWindowSize = int(100) // Minimum observed samples to filter out sample windows with not enough significant samples
)

Expand Down
2 changes: 1 addition & 1 deletion patterns/pool/example_generic_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func ExamplePool() {
var JobKeyID = JobKey("job_id")

l := 1000 // limit to adjustable 1000 concurrent requests.
delegateLimit := limit.NewDefaultAIMLimit(
delegateLimit := limit.NewDefaultAIMDLimit(
"aimd_limiter",
nil,
)
Expand Down

0 comments on commit 875d77d

Please sign in to comment.