forked from External/ergo
maintain lenBytes as a running count
This commit is contained in:
parent
2779fe7c10
commit
8efbc4bc32
3 changed files with 7 additions and 16 deletions
|
|
@ -146,6 +146,7 @@ type MultilineBatch struct {
|
|||
target string
|
||||
responseLabel string // this is the value of the labeled-response tag sent with BATCH
|
||||
message utils.SplitMessage
|
||||
lenBytes int
|
||||
tags map[string]string
|
||||
}
|
||||
|
||||
|
|
@ -168,7 +169,7 @@ func (s *Session) EndMultilineBatch(label string) (batch MultilineBatch, err err
|
|||
s.fakelag.Unsuspend()
|
||||
|
||||
// heuristics to estimate how much data they used while fakelag was suspended
|
||||
fakelagBill := (batch.message.LenBytes() / 512) + 1
|
||||
fakelagBill := (batch.lenBytes / 512) + 1
|
||||
fakelagBillLines := (batch.message.LenLines() * 60) / 512
|
||||
if fakelagBill < fakelagBillLines {
|
||||
fakelagBill = fakelagBillLines
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue