mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-11 02:58:11 -07:00
(done) replace redigo with go-redis
* replace redis keys with RawString encoded values (delete SerializedPeer) * merge peers got from pre-hools with store data
This commit is contained in:
@@ -15,7 +15,7 @@ func init() {
|
||||
|
||||
var promResponseDurationMilliseconds = prometheus.NewHistogramVec(
|
||||
prometheus.HistogramOpts{
|
||||
Name: "chihaya_http_response_duration_milliseconds",
|
||||
Name: "mochi_http_response_duration_milliseconds",
|
||||
Help: "The duration of time it takes to receive and write a response to an API request",
|
||||
Buckets: prometheus.ExponentialBuckets(9.375, 2, 10),
|
||||
},
|
||||
|
||||
@@ -103,8 +103,7 @@ func compact4(peer bittorrent.Peer) (buf []byte) {
|
||||
} else {
|
||||
buf = ip
|
||||
}
|
||||
buf = append(buf, byte(peer.Port>>8))
|
||||
buf = append(buf, byte(peer.Port&0xff))
|
||||
buf = append(buf, byte(peer.Port>>8), byte(peer.Port))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -114,8 +113,7 @@ func compact6(peer bittorrent.Peer) (buf []byte) {
|
||||
} else {
|
||||
buf = ip
|
||||
}
|
||||
buf = append(buf, byte(peer.Port>>8))
|
||||
buf = append(buf, byte(peer.Port&0xff))
|
||||
buf = append(buf, byte(peer.Port>>8), byte(peer.Port))
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user