File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -68,9 +68,11 @@ func (m *Decouple) Output() <-chan mirror.Request {
68
68
69
69
func (m * Decouple ) SetInput (c <- chan mirror.Request ) {
70
70
dropped := uint32 (0 )
71
+ processed := uint32 (0 )
71
72
72
73
go func () {
73
74
for r := range c {
75
+ atomic .AddUint32 (& processed , 1 )
74
76
m .ctx .HandledRequest ()
75
77
select {
76
78
case m .out <- r :
@@ -85,12 +87,13 @@ func (m *Decouple) SetInput(c <-chan mirror.Request) {
85
87
if ! m .quiet {
86
88
go func () {
87
89
for range time .Tick (logDroppedInterval ) {
88
- v := atomic .SwapUint32 (& dropped , 0 )
89
- if v == 0 {
90
+ d := atomic .SwapUint32 (& dropped , 0 )
91
+ p := atomic .SwapUint32 (& processed , 0 )
92
+ if d == 0 {
90
93
continue
91
94
}
92
95
93
- log .Warnf ("%s: dropped %d requests" , DecoupleName , v )
96
+ log .Warnf ("%s: dropped %d of %d requests" , DecoupleName , d , p )
94
97
}
95
98
}()
96
99
}
You can’t perform that action at this time.
0 commit comments