-
Notifications
You must be signed in to change notification settings - Fork 2
/
metrics.go
35 lines (31 loc) · 1.1 KB
/
metrics.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main
import "fmt"
type Metrics struct {
ChannelBufferSize *ChannelBufferSizeMetrics
}
type ChannelBufferSizeMetrics struct {
Monitor uint
Pipe uint
DataProcessor uint
DataAdapter uint
DataObjectStore uint
}
func NewMetrics() *Metrics {
defaultChannelBufferSizeMetrics := &ChannelBufferSizeMetrics{
MinMonitorChannelBufferSize,
MinPipeDataChannelBufferSize,
MinDataProcessorChannelBufferSize,
MinDataAdapterChannelBufferSize,
MinDataObjectStoreChannelBufferSize,
}
defaultMetrics := &Metrics{defaultChannelBufferSizeMetrics}
return defaultMetrics
}
func (m *Metrics) GetMetricsInfo(title string) string {
report := fmt.Sprintf("%s ... Channel Buffer Size Metrics ... \n", title)
if title == "" {
report = fmt.Sprint("Metrics Info : Channel Buffer Size Metrics ... \n")
}
report += fmt.Sprintf("Monitor:[%d], Pipe:[%d], DataProcessor:[%d], DataAdapter:[%d], DataObjectStore:[%d] \n", m.ChannelBufferSize.Monitor, m.ChannelBufferSize.Pipe, m.ChannelBufferSize.DataProcessor, m.ChannelBufferSize.DataAdapter, m.ChannelBufferSize.DataObjectStore)
return report
}