IsEnabled returns whether stats tracking is enabled in the context.
(ctx context.Context)
| 44 | |
| 45 | // IsEnabled returns whether stats tracking is enabled in the context. |
| 46 | func IsEnabled(ctx context.Context) bool { |
| 47 | // When query statistics are enabled, the stats object is already initialised |
| 48 | // within the context, so we can just check it. |
| 49 | return FromContext(ctx) != nil |
| 50 | } |
| 51 | |
| 52 | func (s *QueryStats) Copy() *QueryStats { |
| 53 | if s == nil { |
no test coverage detected