Comments (9)
+1 for EWMA
Whatcha think of this?
https://godoc.org/github.com/rcrowley/go-metrics#EWMA
https://github.com/rcrowley/go-metrics
from kubo.
Yeap, Agreed.
from kubo.
Looks like go-metrics EWMA counts number of events, not value averages: https://github.com/rcrowley/go-metrics/blob/3be59ceb5538550555459fb77d0efe0e218cdfc7/ewma.go#L79-L118 Am i looking at this wrong?
from kubo.
Using a library is probably overkill, to implement it you simply need to do:
const w float32 = 0.6 // set a weight for how fast the average changes
...
ping := peer.Ping() // get the current latency
avgPing = ping*w + avgPing*(1-w) // update EWMA
So if our w
is set to 0.75, our average is at 100ms, then we send a new ping and get 50ms, the average will update to 87.5ms.
from kubo.
@mappum +1
from kubo.
Using a library is probably overkill
you simply need to do
But you're right, no need to use a library as bloated as that. Maybe implement it in one small package.
all of this will get easier once ipfs can be a package manager for go code
from kubo.
@jbenet where do you get all of these images?
from kubo.
That's @substack's avatar
from kubo.
I think this is done already.
from kubo.
Related Issues (20)
- Ipfs kubo node memory usage increases endlessly HOT 4
- /api/v0/get can't save file and not equal cmd: ipfs get HOT 4
- kubo behind haproxy unable to return deserialized responses HOT 3
- Exception 0xc0000005 0x8 0x0 0x0 when try to run ipfs. HOT 2
- Binding UDP sockets to a non-IP address HOT 3
- Lost Some of the files HOT 2
- panic: runtime error: invalid memory address or nil pointer dereference
- Memory leak HOT 19
- Add ability to deny serving any `Paths` content on a gateway by default
- Debian handler scripts - Copy or Submodule? HOT 1
- Set the public gateway in the web UI, custom ports are not accepted.
- Add a grace period to obtain the lock to avoid "Error: lock /data/ipfs/repo.lock: someone else has the lock"
- Download & upload IPNS records through API / CLI HOT 3
- race condition bug or a flaky test: TestAddMultipleGCLive
- outdated coreiface/path reference in rpc example
- Release 0.31
- [question] How to failfast when get a none-exists CID HOT 1
- go1.23 timers cause issues with libp2p connmgr and more HOT 3
- Misleading error when attempting to add a socket file
- Systemd service fails to start when IPFS_PATH is not ~/.ipfs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kubo.