Skip to content

Commit

Permalink
fix(FEC-12995): report manifestMaxDownloadTime and segmentMaxDownload…
Browse files Browse the repository at this point in the history
…Time in seconds instead of miliseconfs (#107)
  • Loading branch information
giladna authored Apr 25, 2023
1 parent cf98bd8 commit ac95660
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -281,11 +281,11 @@ private void addViewParams(Map<String, String> 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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit ac95660

Please sign in to comment.