VOL-4034: Per event.proto definition, the units of timestamp is in seconds.
- Move to voltha-lib-go version 4.3.1
- Bump adapter version to 3.3.2
Change-Id: Ia37527d2c09fad2c2772b5d6ba5e64035f177a91
diff --git a/internal/pkg/core/device_handler.go b/internal/pkg/core/device_handler.go
index 53b33f5..fdb0859 100644
--- a/internal/pkg/core/device_handler.go
+++ b/internal/pkg/core/device_handler.go
@@ -485,7 +485,7 @@
}
func (dh *DeviceHandler) handleOltIndication(ctx context.Context, oltIndication *oop.OltIndication) error {
- raisedTs := time.Now().UnixNano()
+ raisedTs := time.Now().Unix()
if oltIndication.OperState == "up" && dh.transitionMap.currentDeviceState != deviceStateUp {
dh.transitionMap.Handle(ctx, DeviceUpInd)
} else if oltIndication.OperState == "down" {
@@ -503,7 +503,7 @@
// nolint: gocyclo
func (dh *DeviceHandler) handleIndication(ctx context.Context, indication *oop.Indication) {
- raisedTs := time.Now().UnixNano()
+ raisedTs := time.Now().Unix()
switch indication.Data.(type) {
case *oop.Indication_OltInd:
span, ctx := log.CreateChildSpan(ctx, "olt-indication", log.Fields{"device-id": dh.device.Id})
@@ -642,7 +642,7 @@
//Clear olt communication failure event
dh.device.ConnectStatus = voltha.ConnectStatus_REACHABLE
dh.device.OperStatus = voltha.OperStatus_ACTIVE
- raisedTs := time.Now().UnixNano()
+ raisedTs := time.Now().Unix()
go dh.eventMgr.oltCommunicationEvent(ctx, dh.device, raisedTs)
//check adapter and agent reconcile status
@@ -1157,7 +1157,7 @@
}
var alarmInd oop.OnuAlarmIndication
- raisedTs := time.Now().UnixNano()
+ raisedTs := time.Now().Unix()
if _, loaded := dh.discOnus.LoadOrStore(sn, true); loaded {
/* When PON cable disconnected and connected back from OLT, it was expected OnuAlarmIndication
@@ -1237,7 +1237,7 @@
"pon-intf-id": ponintfid,
"serial-number": sn}, err)
}
- if err := dh.eventMgr.OnuDiscoveryIndication(ctx, onuDiscInd, dh.device.Id, onuDevice.Id, onuID, sn, time.Now().UnixNano()); err != nil {
+ if err := dh.eventMgr.OnuDiscoveryIndication(ctx, onuDiscInd, dh.device.Id, onuDevice.Id, onuID, sn, time.Now().Unix()); err != nil {
logger.Warnw(ctx, "discovery-indication-failed", log.Fields{"error": err})
}
logger.Infow(ctx, "onu-child-device-added",
@@ -1336,7 +1336,7 @@
}
if onuInd.OperState == "down" && onuInd.FailReason != oop.OnuIndication_ONU_ACTIVATION_FAIL_REASON_NONE {
- if err := dh.eventMgr.onuActivationIndication(ctx, onuActivationFailEvent, onuInd, dh.device.Id, time.Now().UnixNano()); err != nil {
+ if err := dh.eventMgr.onuActivationIndication(ctx, onuActivationFailEvent, onuInd, dh.device.Id, time.Now().Unix()); err != nil {
logger.Warnw(ctx, "onu-activation-indication-reporting-failed", log.Fields{"error": err})
}
}
@@ -2043,7 +2043,7 @@
}
//raise olt communication failure event
- raisedTs := time.Now().UnixNano()
+ raisedTs := time.Now().Unix()
device.ConnectStatus = voltha.ConnectStatus_UNREACHABLE
device.OperStatus = voltha.OperStatus_UNKNOWN
go dh.eventMgr.oltCommunicationEvent(ctx, device, raisedTs)
diff --git a/internal/pkg/core/openolt.go b/internal/pkg/core/openolt.go
index d7e5b5a..6564e29 100644
--- a/internal/pkg/core/openolt.go
+++ b/internal/pkg/core/openolt.go
@@ -314,6 +314,36 @@
return nil, olterrors.ErrNotImplemented
}
+//Download_onu_image unimplemented
+func (oo *OpenOLT) Download_onu_image(ctx context.Context, request *voltha.DeviceImageDownloadRequest) (*voltha.DeviceImageResponse, error) {
+ return nil, olterrors.ErrNotImplemented
+}
+
+//Get_onu_image_status unimplemented
+func (oo *OpenOLT) Get_onu_image_status(ctx context.Context, in *voltha.DeviceImageRequest) (*voltha.DeviceImageResponse, error) {
+ return nil, olterrors.ErrNotImplemented
+}
+
+//Abort_onu_image_upgrade unimplemented
+func (oo *OpenOLT) Abort_onu_image_upgrade(ctx context.Context, in *voltha.DeviceImageRequest) (*voltha.DeviceImageResponse, error) {
+ return nil, olterrors.ErrNotImplemented
+}
+
+//Get_onu_images unimplemented
+func (oo *OpenOLT) Get_onu_images(ctx context.Context, deviceID string) (*voltha.OnuImages, error) {
+ return nil, olterrors.ErrNotImplemented
+}
+
+//Activate_onu_image unimplemented
+func (oo *OpenOLT) Activate_onu_image(ctx context.Context, in *voltha.DeviceImageRequest) (*voltha.DeviceImageResponse, error) {
+ return nil, olterrors.ErrNotImplemented
+}
+
+//Commit_onu_image unimplemented
+func (oo *OpenOLT) Commit_onu_image(ctx context.Context, in *voltha.DeviceImageRequest) (*voltha.DeviceImageResponse, error) {
+ return nil, olterrors.ErrNotImplemented
+}
+
// Enable_port to Enable PON/NNI interface
func (oo *OpenOLT) Enable_port(ctx context.Context, deviceID string, port *voltha.Port) error {
logger.Infow(ctx, "Enable_port", log.Fields{"device-id": deviceID, "port": port})
diff --git a/internal/pkg/core/statsmanager.go b/internal/pkg/core/statsmanager.go
index c7b149f..6fc3e53 100755
--- a/internal/pkg/core/statsmanager.go
+++ b/internal/pkg/core/statsmanager.go
@@ -576,10 +576,10 @@
volthaEventSubCatgry = voltha.EventSubCategory_ONT
}
- raisedTs := time.Now().UnixNano()
+ raisedTs := time.Now().Unix()
mmd := voltha.MetricMetaData{
Title: statType,
- Ts: float64(raisedTs) / (1.0 * 1e9),
+ Ts: float64(raisedTs),
Context: metricsContext,
DeviceId: devID,
}
@@ -589,7 +589,7 @@
ke.SliceData = []*voltha.MetricInformation{&metricInfo}
ke.Type = voltha.KpiEventType_slice
- ke.Ts = float64(time.Now().UnixNano()) / (1.0 * 1e9)
+ ke.Ts = float64(raisedTs)
if err := StatMgr.Device.EventProxy.SendKpiEvent(ctx, "STATS_EVENT", &ke, voltha.EventCategory_EQUIPMENT, volthaEventSubCatgry, raisedTs); err != nil {
logger.Errorw(ctx, "failed-to-send-stats", log.Fields{"err": err})