Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBasicMetricCollector ¶
func NewBasicMetricCollector(cfg BasicMetricCollectorConfig) metric.Collector
func NewBufferMetricCollector ¶
func NewBufferMetricCollector(cfg BufferMetricCollectorConfig) metric.Collector
Types ¶
type BasicMetricCollectorConfig ¶
type BasicMetricCollectorConfig struct { // This function is called sequentially, // the next function will be called only after the current one returns, this function is blocking. CollectMetricFunc CollectMetricFunc // This function is called only once, for closing work, this function is blocking. // This function only is called when all CollectMetricFunc calls are done. DoneFunc DoneFunc }
type BufferMetricCollectorConfig ¶
type BufferMetricCollectorConfig struct { // Default is 10000. MetricsBufferSize int // Default is 5s. CollectMetricsInterval time.Duration // This function is called sequentially, // the next function will be called only after the current one returns, this function is blocking. // // Call rules: // 1. When the number of collected metrics exceeds MetricsBufferSize. // 2. When the time reaches CollectMetricsInterval. // 3. When receiving a close signal. CollectMetricsFunc CollectMetricsFunc // This function is called only once, for closing work, this function is blocking. // This function only is called when all CollectMetricsFunc calls are done. DoneFunc DoneFunc }
type CollectMetricFunc ¶
type CollectMetricsFunc ¶
Click to show internal directories.
Click to hide internal directories.