Skip to content

Commit 20ada42

Browse files
committed
Print gcs duration
1 parent 3612f86 commit 20ada42

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,17 +195,21 @@ func (t *transport) gc(gen generation) {
195195
}
196196
req.Header.Set(gciHeader, gen.string())
197197
atomic.StoreUint64(&t.shed, 0)
198+
199+
start := time.Now()
198200
resp, err := client.Do(req)
199201
if err != nil {
200202
panic(fmt.Sprintf("Err trying to trigger gc:%q\n", err))
201203
}
204+
end := time.Now()
202205
if resp.StatusCode != http.StatusOK {
203206
panic(fmt.Sprintf("GC trigger returned status code which is no OK:%v\n", resp.StatusCode))
204207
}
205208
if resp != nil {
206209
ioutil.ReadAll(resp.Body)
207210
resp.Body.Close()
208211
}
212+
fmt.Printf("%s,%v", gen.string(), end.Sub(start).Nanoseconds()/1e3)
209213
}
210214

211215
////////// PROXY

0 commit comments

Comments
 (0)