mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
*: make receiver names consistent
This commit is contained in:
parent
98e4a05068
commit
4fa1dd196c
@ -242,4 +242,4 @@ func (e *Election) Key() string { return e.leaderKey }
|
|||||||
func (e *Election) Rev() int64 { return e.leaderRev }
|
func (e *Election) Rev() int64 { return e.leaderRev }
|
||||||
|
|
||||||
// Header is the response header from the last successful election proposal.
|
// Header is the response header from the last successful election proposal.
|
||||||
func (m *Election) Header() *pb.ResponseHeader { return m.hdr }
|
func (e *Election) Header() *pb.ResponseHeader { return e.hdr }
|
||||||
|
@ -180,8 +180,8 @@ func (kv *kvPrefix) unprefixTxnResponse(resp *clientv3.TxnResponse) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *kvPrefix) prefixInterval(key, end []byte) (pfxKey []byte, pfxEnd []byte) {
|
func (kv *kvPrefix) prefixInterval(key, end []byte) (pfxKey []byte, pfxEnd []byte) {
|
||||||
return prefixInterval(p.pfx, key, end)
|
return prefixInterval(kv.pfx, key, end)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (kv *kvPrefix) prefixCmps(cs []clientv3.Cmp) []clientv3.Cmp {
|
func (kv *kvPrefix) prefixCmps(cs []clientv3.Cmp) []clientv3.Cmp {
|
||||||
|
@ -221,16 +221,16 @@ func compactIndex(rev int64, available map[revision]struct{}, emptyki *[]*keyInd
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *treeIndex) Equal(bi index) bool {
|
func (ti *treeIndex) Equal(bi index) bool {
|
||||||
b := bi.(*treeIndex)
|
b := bi.(*treeIndex)
|
||||||
|
|
||||||
if a.tree.Len() != b.tree.Len() {
|
if ti.tree.Len() != b.tree.Len() {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
equal := true
|
equal := true
|
||||||
|
|
||||||
a.tree.Ascend(func(item btree.Item) bool {
|
ti.tree.Ascend(func(item btree.Item) bool {
|
||||||
aki := item.(*keyIndex)
|
aki := item.(*keyIndex)
|
||||||
bki := b.tree.Get(item).(*keyIndex)
|
bki := b.tree.Get(item).(*keyIndex)
|
||||||
if !aki.equal(bki) {
|
if !aki.equal(bki) {
|
||||||
|
@ -118,20 +118,20 @@ func (sp *secondPoints) getTimeSeries() TimeSeries {
|
|||||||
return tslice
|
return tslice
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ts TimeSeries) String() string {
|
func (t TimeSeries) String() string {
|
||||||
buf := new(bytes.Buffer)
|
buf := new(bytes.Buffer)
|
||||||
wr := csv.NewWriter(buf)
|
wr := csv.NewWriter(buf)
|
||||||
if err := wr.Write([]string{"UNIX-SECOND", "MIN-LATENCY-MS", "AVG-LATENCY-MS", "MAX-LATENCY-MS", "AVG-THROUGHPUT"}); err != nil {
|
if err := wr.Write([]string{"UNIX-SECOND", "MIN-LATENCY-MS", "AVG-LATENCY-MS", "MAX-LATENCY-MS", "AVG-THROUGHPUT"}); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
rows := [][]string{}
|
rows := [][]string{}
|
||||||
for i := range ts {
|
for i := range t {
|
||||||
row := []string{
|
row := []string{
|
||||||
fmt.Sprintf("%d", ts[i].Timestamp),
|
fmt.Sprintf("%d", t[i].Timestamp),
|
||||||
ts[i].MinLatency.String(),
|
t[i].MinLatency.String(),
|
||||||
ts[i].AvgLatency.String(),
|
t[i].AvgLatency.String(),
|
||||||
ts[i].MaxLatency.String(),
|
t[i].MaxLatency.String(),
|
||||||
fmt.Sprintf("%d", ts[i].ThroughPut),
|
fmt.Sprintf("%d", t[i].ThroughPut),
|
||||||
}
|
}
|
||||||
rows = append(rows, row)
|
rows = append(rows, row)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user