mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-10 07:04:24 +00:00
parent
fadf9c6286
commit
d89b0cdace
2 changed files with 2 additions and 3 deletions
|
@ -23,7 +23,7 @@ func (poolMetrics) recordBufferRetrival() {
|
|||
|
||||
func (poolMetrics) recordBufferReturn(buf *Buffer) {
|
||||
activeBufferCount.Dec()
|
||||
totalBufferSize.Add(float64(buf.Len()))
|
||||
totalBufferSize.Add(float64(buf.Cap()))
|
||||
totalBufferLength.Add(float64(buf.Len()))
|
||||
buf.recordMetric()
|
||||
}
|
||||
|
|
|
@ -62,8 +62,7 @@ func (b *BufferWriter) Write(data []byte) (int, error) {
|
|||
b.size += size
|
||||
start := time.Now()
|
||||
defer func(start time.Time) {
|
||||
bufferLength := int64(b.buf.Len())
|
||||
b.metrics.recordDataProcessed(bufferLength, time.Since(start))
|
||||
b.metrics.recordDataProcessed(int64(size), time.Since(start))
|
||||
|
||||
}(start)
|
||||
return b.buf.Write(data)
|
||||
|
|
Loading…
Reference in a new issue