forked from quic-go/quic-go
trace packets that are sent outside of a connection
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/lucas-clemente/quic-go/internal/protocol"
|
||||
"github.com/lucas-clemente/quic-go/logging"
|
||||
|
||||
"go.opencensus.io/stats"
|
||||
@@ -65,6 +66,16 @@ func (t *tracer) TracerForConnection(p logging.Perspective, _ logging.Connection
|
||||
return newConnTracer(t, p)
|
||||
}
|
||||
|
||||
func (t *tracer) SentPacket(_ net.Addr, hdr *logging.Header, _ protocol.ByteCount, _ []logging.Frame) {
|
||||
stats.RecordWithTags(
|
||||
context.Background(),
|
||||
[]tag.Mutator{
|
||||
tag.Upsert(keyPacketType, packetType(logging.PacketTypeFromHeader(hdr)).String()),
|
||||
},
|
||||
sentPackets.M(1),
|
||||
)
|
||||
}
|
||||
|
||||
func (t *tracer) DroppedPacket(net.Addr, logging.PacketType, logging.ByteCount, logging.PacketDropReason) {
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user