github.com/artisanhe/tools@v1.0.1-0.20210607022958-19a8fef2eb04/catgo/cat-go/message/metric.go (about)

     1  package message
     2  
     3  type Metric struct {
     4  	Message
     5  }
     6  
     7  func (e *Metric) Complete() {
     8  	if e.Message.flush != nil {
     9  		e.Message.flush(e)
    10  	}
    11  }
    12  
    13  func NewMetric(mtype, name string, flush Flush) *Metric {
    14  	return &Metric{
    15  		Message: NewMessage(mtype, name, flush),
    16  	}
    17  }