Skip to content
Snippets Groups Projects
Commit 900aa626 authored by Ethan Buchman's avatar Ethan Buchman
Browse files

come at me bro

parent 49e9fe9e
No related branches found
No related tags found
No related merge requests found
...@@ -53,10 +53,6 @@ ...@@ -53,10 +53,6 @@
"ImportPath": "github.com/mattn/go-isatty", "ImportPath": "github.com/mattn/go-isatty",
"Rev": "fdbe02a1b44e75977b2690062b83cf507d70c013" "Rev": "fdbe02a1b44e75977b2690062b83cf507d70c013"
}, },
{
"ImportPath": "github.com/mxk/go-flowrate/flowrate",
"Rev": "cca7078d478f8520f85629ad7c68962d31ed7682"
},
{ {
"ImportPath": "github.com/naoina/go-stringutil", "ImportPath": "github.com/naoina/go-stringutil",
"Rev": "360db0db4b01d34e12a2ec042c09e7d37fece761" "Rev": "360db0db4b01d34e12a2ec042c09e7d37fece761"
...@@ -81,6 +77,10 @@ ...@@ -81,6 +77,10 @@
"ImportPath": "github.com/tendermint/ed25519", "ImportPath": "github.com/tendermint/ed25519",
"Rev": "533fb6548e2071076888eda3c38749d707ba49bc" "Rev": "533fb6548e2071076888eda3c38749d707ba49bc"
}, },
{
"ImportPath": "github.com/tendermint/flowcontrol",
"Rev": "84d9671090430e8ec80e35b339907e0579b999eb"
},
{ {
"ImportPath": "github.com/tendermint/log15", "ImportPath": "github.com/tendermint/log15",
"Comment": "v2.3-36-g6e46075", "Comment": "v2.3-36-g6e46075",
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
// Written by Maxim Khitrov (November 2012) // Written by Maxim Khitrov (November 2012)
// //
// Package flowrate provides the tools for monitoring and limiting the flow rate // Package flowcontrol provides the tools for monitoring and limiting the
// of an arbitrary data stream. // transfer rate of an arbitrary data stream.
package flowrate package flowcontrol
import ( import (
"math" "math"
...@@ -72,6 +72,14 @@ func (m *Monitor) Update(n int) int { ...@@ -72,6 +72,14 @@ func (m *Monitor) Update(n int) int {
return n return n
} }
// Hack to set the current rEMA.
func (m *Monitor) SetREMA(rEMA float64) {
m.mu.Lock()
m.rEMA = rEMA
m.samples++
m.mu.Unlock()
}
// IO is a convenience method intended to wrap io.Reader and io.Writer method // IO is a convenience method intended to wrap io.Reader and io.Writer method
// execution. It calls m.Update(n) and then returns (n, err) unmodified. // execution. It calls m.Update(n) and then returns (n, err) unmodified.
func (m *Monitor) IO(n int, err error) (int, error) { func (m *Monitor) IO(n int, err error) (int, error) {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Written by Maxim Khitrov (November 2012) // Written by Maxim Khitrov (November 2012)
// //
package flowrate package flowcontrol
import ( import (
"errors" "errors"
...@@ -11,7 +11,7 @@ import ( ...@@ -11,7 +11,7 @@ import (
// ErrLimit is returned by the Writer when a non-blocking write is short due to // ErrLimit is returned by the Writer when a non-blocking write is short due to
// the transfer rate limit. // the transfer rate limit.
var ErrLimit = errors.New("flowrate: flow rate limit exceeded") var ErrLimit = errors.New("flowcontrol: transfer rate limit exceeded")
// Limiter is implemented by the Reader and Writer to provide a consistent // Limiter is implemented by the Reader and Writer to provide a consistent
// interface for monitoring and controlling data transfer. // interface for monitoring and controlling data transfer.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Written by Maxim Khitrov (November 2012) // Written by Maxim Khitrov (November 2012)
// //
package flowrate package flowcontrol
import ( import (
"math" "math"
......
...@@ -5,7 +5,7 @@ import ( ...@@ -5,7 +5,7 @@ import (
"sync" "sync"
"time" "time"
flow "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/mxk/go-flowrate/flowrate" flow "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/flowcontrol"
. "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/tendermint/common" . "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/tendermint/common"
"github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/tendermint/types" "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/tendermint/types"
) )
......
...@@ -10,7 +10,7 @@ import ( ...@@ -10,7 +10,7 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
flow "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/mxk/go-flowrate/flowrate" flow "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/flowcontrol"
. "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/tendermint/common" . "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/tendermint/common"
"github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/tendermint/wire" //"github.com/tendermint/log15" "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/tendermint/wire" //"github.com/tendermint/log15"
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment