github.com/gogf/gf/v2@v2.7.4/os/gmetric/gmetric_noop_updown_counter_performer.go (about) 1 // Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved. 2 // 3 // This Source Code Form is subject to the terms of the MIT License. 4 // If a copy of the MIT was not distributed with this file, 5 // You can obtain one at https://github.com/gogf/gf. 6 7 package gmetric 8 9 import "context" 10 11 // noopUpDownCounterPerformer is an implementer for interface CounterPerformer with no truly operations. 12 type noopUpDownCounterPerformer struct{} 13 14 // newNoopUpDownCounterPerformer creates and returns a CounterPerformer with no truly operations. 15 func newNoopUpDownCounterPerformer() UpDownCounterPerformer { 16 return noopUpDownCounterPerformer{} 17 } 18 19 // Inc increments the counter by 1. 20 func (noopUpDownCounterPerformer) Inc(ctx context.Context, option ...Option) {} 21 22 // Dec decrements the counter by 1. 23 func (noopUpDownCounterPerformer) Dec(ctx context.Context, option ...Option) {} 24 25 // Add adds the given value to the counter. 26 func (noopUpDownCounterPerformer) Add(ctx context.Context, increment float64, option ...Option) {}