From ac95660820405d3bf7fad565b0f37d1adeb59a27 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Tue, 25 Apr 2023 18:10:04 +0300 Subject: [PATCH] fix(FEC-12995): report manifestMaxDownloadTime and segmentMaxDownloadTime in seconds instead of miliseconfs (#107) --- .../kaltura/playkit/plugins/kava/DataHandler.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kavaplugin/src/main/java/com/kaltura/playkit/plugins/kava/DataHandler.java b/kavaplugin/src/main/java/com/kaltura/playkit/plugins/kava/DataHandler.java index c1120ef..3687685 100644 --- a/kavaplugin/src/main/java/com/kaltura/playkit/plugins/kava/DataHandler.java +++ b/kavaplugin/src/main/java/com/kaltura/playkit/plugins/kava/DataHandler.java @@ -79,8 +79,8 @@ class DataHandler { private String currentAudioLanguage; private String currentCaptionLanguage; private String flavorParamsId; - private long manifestMaxDownloadTime = -1; - private long segmentMaxDownloadTime = -1; + private float manifestMaxDownloadTime = -1; + private float segmentMaxDownloadTime = -1; private long maxConnectDurationMs = -1; private long totalSegmentDownloadTimeMs = 0; private long totalSegmentDownloadSizeByte = 0; @@ -281,11 +281,11 @@ private void addViewParams(Map params) { } if (manifestMaxDownloadTime != -1) { - params.put("manifestDownloadTime", Long.toString(manifestMaxDownloadTime)); + params.put("manifestDownloadTime", Float.toString(manifestMaxDownloadTime)); manifestMaxDownloadTime = -1; } if (segmentMaxDownloadTime != -1) { - params.put("segmentDownloadTime", Long.toString(segmentMaxDownloadTime)); + params.put("segmentDownloadTime", Float.toString(segmentMaxDownloadTime)); segmentMaxDownloadTime = -1; } if (totalSegmentDownloadTimeMs > 0 && totalSegmentDownloadSizeByte > 0) { @@ -395,13 +395,13 @@ void handleTracksAvailable(PlayerEvent.TracksAvailable event) { } void handleSegmentDownloadTime(PlayerEvent.BytesLoaded event) { - segmentMaxDownloadTime = Math.max(event.loadDuration, segmentMaxDownloadTime); + segmentMaxDownloadTime = Math.max(event.loadDuration / Consts.MILLISECONDS_MULTIPLIER_FLOAT, segmentMaxDownloadTime); totalSegmentDownloadSizeByte += event.bytesLoaded; totalSegmentDownloadTimeMs += event.loadDuration; } void handleManifestDownloadTime(PlayerEvent.BytesLoaded event) { - manifestMaxDownloadTime = Math.max(event.loadDuration, manifestMaxDownloadTime); + manifestMaxDownloadTime = Math.max(event.loadDuration / Consts.MILLISECONDS_MULTIPLIER_FLOAT, manifestMaxDownloadTime); } void handleSequenceId(String sequenceId) {