Commit 6f2f8e49 by tonihei Committed by Oliver Woodman

Add rebuffer test metrics to ABR playback tests.

This includes a metric logger class which logs events and generates metrics, and some changes to the Perfgate benchmark config to add the metrics. So far, only rebuffer counts, rebuffer time and startup time are measured, together with auxiliary values of total playback time used for testing and number of playback failures.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161513672
parent 0052a70f
......@@ -78,6 +78,7 @@ public abstract class ExoHostedTest implements HostedTest, ExoPlayer.EventListen
private SimpleExoPlayer player;
private Surface surface;
private ExoPlaybackException playerError;
private ExoPlayer.EventListener playerEventListener;
private boolean playerWasPrepared;
private boolean playerFinished;
private boolean playing;
......@@ -129,6 +130,16 @@ public abstract class ExoHostedTest implements HostedTest, ExoPlayer.EventListen
}
}
/**
* Sets an {@link ExoPlayer.EventListener} to listen for ExoPlayer events during the test.
*/
public final void setEventListener(ExoPlayer.EventListener eventListener) {
this.playerEventListener = eventListener;
if (player != null) {
player.addListener(eventListener);
}
}
// HostedTest implementation
@Override
......@@ -141,6 +152,9 @@ public abstract class ExoHostedTest implements HostedTest, ExoPlayer.EventListen
DrmSessionManager<FrameworkMediaCrypto> drmSessionManager = buildDrmSessionManager(userAgent);
player = buildExoPlayer(host, surface, trackSelector, drmSessionManager);
player.prepare(buildSource(host, Util.getUserAgent(host, userAgent), bandwidthMeter));
if (playerEventListener != null) {
player.addListener(playerEventListener);
}
player.addListener(this);
player.setAudioDebugListener(this);
player.setVideoDebugListener(this);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment