github.com/theQRL/go-zond@v0.1.1/metrics/inactive.go (about) 1 // Copyright 2023 The go-ethereum Authors 2 // This file is part of the go-ethereum library. 3 // 4 // The go-ethereum library is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU Lesser General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // The go-ethereum library is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU Lesser General Public License for more details. 13 // 14 // You should have received a copy of the GNU Lesser General Public License 15 // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. 16 17 package metrics 18 19 // compile-time checks that interfaces are implemented. 20 var ( 21 _ SampleSnapshot = (*emptySnapshot)(nil) 22 _ HistogramSnapshot = (*emptySnapshot)(nil) 23 _ CounterSnapshot = (*emptySnapshot)(nil) 24 _ GaugeSnapshot = (*emptySnapshot)(nil) 25 _ MeterSnapshot = (*emptySnapshot)(nil) 26 _ EWMASnapshot = (*emptySnapshot)(nil) 27 _ TimerSnapshot = (*emptySnapshot)(nil) 28 ) 29 30 type emptySnapshot struct{} 31 32 func (*emptySnapshot) Count() int64 { return 0 } 33 func (*emptySnapshot) Max() int64 { return 0 } 34 func (*emptySnapshot) Mean() float64 { return 0.0 } 35 func (*emptySnapshot) Min() int64 { return 0 } 36 func (*emptySnapshot) Percentile(p float64) float64 { return 0.0 } 37 func (*emptySnapshot) Percentiles(ps []float64) []float64 { return make([]float64, len(ps)) } 38 func (*emptySnapshot) Size() int { return 0 } 39 func (*emptySnapshot) StdDev() float64 { return 0.0 } 40 func (*emptySnapshot) Sum() int64 { return 0 } 41 func (*emptySnapshot) Values() []int64 { return []int64{} } 42 func (*emptySnapshot) Variance() float64 { return 0.0 } 43 func (*emptySnapshot) Value() int64 { return 0 } 44 func (*emptySnapshot) Rate() float64 { return 0.0 } 45 func (*emptySnapshot) Rate1() float64 { return 0.0 } 46 func (*emptySnapshot) Rate5() float64 { return 0.0 } 47 func (*emptySnapshot) Rate15() float64 { return 0.0 } 48 func (*emptySnapshot) RateMean() float64 { return 0.0 }