From 74ee105b282c402e16cdcb30a536069ac287bd0f Mon Sep 17 00:00:00 2001 From: Vitaly Grinberg Date: Tue, 31 Dec 2024 09:02:47 +0200 Subject: [PATCH] fix backport mistake Fixes backport mistake that caused ptpStateChange event never to be sent --- plugins/ptp_operator/metrics/logparser.go | 1 - plugins/ptp_operator/metrics/metrics_test.go | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ptp_operator/metrics/logparser.go b/plugins/ptp_operator/metrics/logparser.go index 62fe8e4c..cc5d9b8b 100644 --- a/plugins/ptp_operator/metrics/logparser.go +++ b/plugins/ptp_operator/metrics/logparser.go @@ -394,7 +394,6 @@ func (p *PTPEventManager) ParseGMLogs(processName, configName, output string, fi SyncState.With(map[string]string{"process": processName, "node": ptpNodeName, "iface": alias}).Set(GetSyncStateID(syncState)) // status metrics ptpStats[masterType].SetPtpDependentEventState(clockState, ptpStats.HasMetrics(processName), ptpStats.HasMetricHelp(processName)) - ptpStats[masterType].SetLastSyncState(clockState.State) ptpStats[masterType].SetAlias(alias) // If GM is locked/Freerun/Holdover then ptp state change event diff --git a/plugins/ptp_operator/metrics/metrics_test.go b/plugins/ptp_operator/metrics/metrics_test.go index 52058992..c0f528e1 100644 --- a/plugins/ptp_operator/metrics/metrics_test.go +++ b/plugins/ptp_operator/metrics/metrics_test.go @@ -280,6 +280,7 @@ var testCases = []TestCase{ expectedNmeaStatus: SKIP, expectedPpsStatus: SKIP, expectedClockClassMetrics: SKIP, + expectedEvent: ptp.PtpStateChange, }, { log: "gnss[1000000500]:[ts2phc.0.config] ens2f1 gnss_status 3 offset 5 s2",