1
0
Fork 0
mirror of https://github.com/imjasonh/gcsbuf synced 2026-07-08 09:05:20 +00:00
gcsbuf/observe.go
Jason Hall f6fd234e2d add test binary, observability
Signed-off-by: Jason Hall <imjasonh@gmail.com>
2026-03-24 14:54:02 -04:00

14 lines
402 B
Go

package buf
import "time"
// OnOp is called after each GCS API operation completes.
// op identifies the operation (e.g. "upload", "attrs", "compose", "delete", "rewrite", "patch", "read").
// d is the wall-clock duration. err is nil on success.
type OnOp func(op string, d time.Duration, err error)
func (f OnOp) observe(op string, d time.Duration, err error) {
if f != nil {
f(op, d, err)
}
}