github.com/gogf/gf/v2@v2.7.4/os/gmetric/gmetric_meter_metric_instrument.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 // localMetricInstrument implements interface MetricInstrument. 10 type localInstrumentInfo struct { 11 name string 12 version string 13 } 14 15 // newInstrumentInfo creates and returns a MetricInstrument. 16 func (meter *localMeter) newInstrumentInfo() InstrumentInfo { 17 return &localInstrumentInfo{ 18 name: meter.Instrument, 19 version: meter.InstrumentVersion, 20 } 21 } 22 23 // Name returns the instrument name of the metric. 24 func (l *localInstrumentInfo) Name() string { 25 return l.name 26 } 27 28 // Version returns the instrument version of the metric. 29 func (l *localInstrumentInfo) Version() string { 30 return l.version 31 }