Remove dead codes in NPM-related metrics from telemetry and NPM (#999)
This commit is contained in:
Родитель
01c12d8f40
Коммит
3817a98350
15
npm/npm.go
15
npm/npm.go
|
@ -16,7 +16,6 @@ import (
|
|||
"github.com/Azure/azure-container-networking/npm/ipsm"
|
||||
"github.com/Azure/azure-container-networking/npm/metrics"
|
||||
"github.com/Azure/azure-container-networking/npm/util"
|
||||
"github.com/Azure/azure-container-networking/telemetry"
|
||||
"k8s.io/apimachinery/pkg/version"
|
||||
"k8s.io/client-go/informers"
|
||||
coreinformers "k8s.io/client-go/informers/core/v1"
|
||||
|
@ -63,7 +62,6 @@ type NetworkPolicyManager struct {
|
|||
ipsMgr *ipsm.IpsetManager
|
||||
npmNamespaceCache *npmNamespaceCache
|
||||
// Azure-specific variables
|
||||
clusterState telemetry.ClusterState
|
||||
k8sServerVersion *version.Info
|
||||
NodeName string
|
||||
version string
|
||||
|
@ -83,15 +81,10 @@ func NewNetworkPolicyManager(informerFactory informers.SharedInformerFactory, ex
|
|||
npInformer: informerFactory.Networking().V1().NetworkPolicies(),
|
||||
ipsMgr: ipsm.NewIpsetManager(exec),
|
||||
npmNamespaceCache: &npmNamespaceCache{nsMap: make(map[string]*Namespace)},
|
||||
clusterState: telemetry.ClusterState{
|
||||
PodCount: 0,
|
||||
NsCount: 0,
|
||||
NwPolicyCount: 0,
|
||||
},
|
||||
k8sServerVersion: k8sServerVersion,
|
||||
NodeName: os.Getenv("HOSTNAME"),
|
||||
version: npmVersion,
|
||||
TelemetryEnabled: true,
|
||||
k8sServerVersion: k8sServerVersion,
|
||||
NodeName: os.Getenv("HOSTNAME"),
|
||||
version: npmVersion,
|
||||
TelemetryEnabled: true,
|
||||
}
|
||||
|
||||
// create pod controller
|
||||
|
|
|
@ -104,29 +104,6 @@ type AIMetric struct {
|
|||
Metric aitelemetry.Metric
|
||||
}
|
||||
|
||||
// ClusterState contains the current kubernetes cluster state.
|
||||
type ClusterState struct {
|
||||
PodCount int
|
||||
NsCount int
|
||||
NwPolicyCount int
|
||||
}
|
||||
|
||||
// NPMReport structure.
|
||||
type NPMReport struct {
|
||||
IsNewInstance bool
|
||||
ClusterID string
|
||||
NodeName string
|
||||
InstanceName string
|
||||
NpmVersion string
|
||||
KubernetesVersion string
|
||||
ErrorMessage string
|
||||
EventMessage string
|
||||
UpTime string
|
||||
Timestamp string
|
||||
ClusterState ClusterState
|
||||
Metadata common.Metadata `json:"compute"`
|
||||
}
|
||||
|
||||
// ReportManager structure.
|
||||
type ReportManager struct {
|
||||
HostNetAgentURL string
|
||||
|
@ -143,15 +120,6 @@ func (report *CNIReport) GetReport(name string, version string, ipamQueryURL str
|
|||
report.GetOSDetails()
|
||||
}
|
||||
|
||||
// GetReport retrives npm and kubernetes cluster related info and create a report structure.
|
||||
func (report *NPMReport) GetReport(clusterID, nodeName, npmVersion, kubernetesVersion string, clusterState ClusterState) {
|
||||
report.ClusterID = clusterID
|
||||
report.NodeName = nodeName
|
||||
report.NpmVersion = npmVersion
|
||||
report.KubernetesVersion = kubernetesVersion
|
||||
report.ClusterState = clusterState
|
||||
}
|
||||
|
||||
// SendReport will send telemetry report to HostNetAgent.
|
||||
func (reportMgr *ReportManager) SendReport(tb *TelemetryBuffer) error {
|
||||
var err error
|
||||
|
|
Загрузка…
Ссылка в новой задаче