func newEntryReader(r io.Reader, id types.ID) *entryReader { return &entryReader{ r: r, id: id, ents: metrics.GetMap("rafthttp.stream.entries_received").NewCounter(id.String()), bytes: metrics.GetMap("rafthttp.stream.bytes_received").NewCounter(id.String()), lastIndex: metrics.GetMap("rafthttp.stream.last_index_received").NewGauge(id.String()), } }
func newEntryWriter(w io.Writer, id types.ID) *entryWriter { ew := &entryWriter{ w: w, id: id, ents: metrics.GetMap("rafthttp.stream.entries_sent").NewCounter(id.String()), bytes: metrics.GetMap("rafthttp.stream.bytes_sent").NewCounter(id.String()), lastIndex: metrics.GetMap("rafthttp.stream.last_index_sent").NewGauge(id.String()), } return ew }
func (er *entryReader) stop() { metrics.GetMap("rafthttp.stream.entries_received").Delete(er.id.String()) metrics.GetMap("rafthttp.stream.bytes_received").Delete(er.id.String()) metrics.GetMap("rafthttp.stream.last_index_received").Delete(er.id.String()) }
func (ew *entryWriter) stop() { metrics.GetMap("rafthttp.stream.entries_sent").Delete(ew.id.String()) metrics.GetMap("rafthttp.stream.bytes_sent").Delete(ew.id.String()) metrics.GetMap("rafthttp.stream.last_index_sent").Delete(ew.id.String()) }