VOL-3727 Support in OLT adapter to send periodic onu stats and gem stats

If enableOnuStats and enableGemStats flags are set, olt adapter collects these stats from agent and sends kpis to kafka. Default values are false.

Change-Id: Ifa96140518921d3d79118118a971d77c798dc2ab
diff --git a/internal/pkg/config/config.go b/internal/pkg/config/config.go
index e720890..4e6fd5f 100644
--- a/internal/pkg/config/config.go
+++ b/internal/pkg/config/config.go
@@ -55,6 +55,8 @@
 	defaultTraceAgentAddress     = "127.0.0.1:6831"
 	defaultLogCorrelationEnabled = true
 	defaultOmccEncryption        = false
+	defaultEnableONUStats        = false
+	defaultEnableGEMStats        = false
 )
 
 // AdapterFlags represents the set of configurations used by the read-write adaptercore service
@@ -86,6 +88,8 @@
 	TraceAgentAddress           string
 	LogCorrelationEnabled       bool
 	OmccEncryption              bool
+	EnableONUStats              bool
+	EnableGEMStats              bool
 }
 
 // NewAdapterFlags returns a new RWCore config
@@ -114,6 +118,8 @@
 		TraceAgentAddress:           defaultTraceAgentAddress,
 		LogCorrelationEnabled:       defaultLogCorrelationEnabled,
 		OmccEncryption:              defaultOmccEncryption,
+		EnableONUStats:              defaultEnableONUStats,
+		EnableGEMStats:              defaultEnableGEMStats,
 	}
 	return &adapterFlags
 }
@@ -193,6 +199,12 @@
 	help = fmt.Sprintf("OMCI Channel encryption status")
 	flag.BoolVar(&(so.OmccEncryption), "omcc_encryption", defaultOmccEncryption, help)
 
+	help = fmt.Sprintf("Enable ONU Statistics")
+	flag.BoolVar(&(so.EnableONUStats), "enable_onu_stats", defaultEnableONUStats, help)
+
+	help = fmt.Sprintf("Enable GEM Statistics")
+	flag.BoolVar(&(so.EnableGEMStats), "enable_gem_stats", defaultEnableGEMStats, help)
+
 	flag.Parse()
 	containerName := getContainerInfo()
 	if len(containerName) > 0 {