telemetry: Update Android frame latency metrics
telemetry: Update Android frame latency metrics

Update the Android SurfaceFlinger-based frame latency metrics to match
the numbers that are tracked downstream. The new method records the time
of the most recent vsync when a new frame is submitted to SurfaceFlinger.
These frame timestamps are used to derive the following animation quality
indicators:

  1. Average frame rate (avg_surface_fps).

  2. Maximum time between frames (max_frame_delay) in number elapsed
     vsync periods.

  3. Number of "janks" or dropped frames during the benchmark
     (jank_count). This is calculated by first taking the frame
     durations:

        duration[i] = timestamp[i + 1] - timestamp[i]

     and then seeing when the duration changes:

        changes[i] = duration[i + 1] - duration[i]

     Every time the frame duration increases by an additional vsync
     interval multiple we count the frame as jank:

        jank_count = sum{1 | max(0, round(changes[i] / vsync_interval)) > 0}

BUG=https://b/8364918


Review URL: https://chromiumcodereview.appspot.com/12438022

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@189006 0039d316-1c4b-4281-b951-d872f2087c98

TheTypoMaster/chromium-crosswalk,mogoweb/chromium-crosswalk,markYoungH/chromium.src,Just-D/chromium-1,axinging/chromium-crosswalk,hujiajie/pa-chromium,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,littlstar/chromium.src,crosswalk-project/chromium-crosswalk-efl,patrickm/chromium.src,markYoungH/chromium.src,chuan9/chromium-crosswalk,fujunwei/chromium-crosswalk,bright-sparks/chromium-spacewalk,Jonekee/chromium.src,hujiajie/pa-chromium,hujiajie/pa-chromium,hgl888/chromium-crosswalk,littlstar/chromium.src,Jonekee/chromium.src,markYoungH/chromium.src,anirudhSK/chromium,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,dednal/chromium.src,bright-sparks/chromium-spacewalk,axinging/chromium-crosswalk,hujiajie/pa-chromium,jaruba/chromium.src,timopulkkinen/BubbleFish,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,Fireblend/chromium-crosswalk,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,pozdnyakov/chromium-crosswalk,dednal/chromium.src,chuan9/chromium-crosswalk,fujunwei/chromium-crosswalk,hujiajie/pa-chromium,littlstar/chromium.src,bright-sparks/chromium-spacewalk,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,anirudhSK/chromium,dushu1203/chromium.src,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,jaruba/chromium.src,littlstar/chromium.src,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,M4sse/chromium.src,jaruba/chromium.src,dednal/chromium.src,bright-sparks/chromium-spacewalk,M4sse/chromium.src,ChromiumWebApps/chromium,axinging/chromium-crosswalk,timopulkkinen/BubbleFish,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,ltilve/chromium,pozdnyakov/chromium-crosswalk,fujunwei/chromium-crosswalk,dushu1203/chromium.src,ltilve/chromium,crosswalk-project/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Jonekee/chromium.src,Jonekee/chromium.src,pozdnyakov/chromium-crosswalk,bright-sparks/chromium-spacewalk,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,patrickm/chromium.src,ondra-novak/chromium.src,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,hujiajie/pa-chromium,chuan9/chromium-crosswalk,ondra-novak/chromium.src,markYoungH/chromium.src,anirudhSK/chromium,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,Chilledheart/chromium,dushu1203/chromium.src,M4sse/chromium.src,chuan9/chromium-crosswalk,timopulkkinen/BubbleFish,mogoweb/chromium-crosswalk,dushu1203/chromium.src,patrickm/chromium.src,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,hujiajie/pa-chromium,hgl888/chromium-crosswalk,Chilledheart/chromium,markYoungH/chromium.src,krieger-od/nwjs_chromium.src,ltilve/chromium,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,chuan9/chromium-crosswalk,M4sse/chromium.src,ondra-novak/chromium.src,ltilve/chromium,axinging/chromium-crosswalk,ChromiumWebApps/chromium,ondra-novak/chromium.src,timopulkkinen/BubbleFish,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,littlstar/chromium.src,Just-D/chromium-1,krieger-od/nwjs_chromium.src,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,markYoungH/chromium.src,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,bright-sparks/chromium-spacewalk,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,mogoweb/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,hgl888/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,ltilve/chromium,Just-D/chromium-1,hgl888/chromium-crosswalk-efl,dednal/chromium.src,krieger-od/nwjs_chromium.src,patrickm/chromium.src,hgl888/chromium-crosswalk,pozdnyakov/chromium-crosswalk,ChromiumWebApps/chromium,anirudhSK/chromium,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,littlstar/chromium.src,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,Fireblend/chromium-crosswalk,Fireblend/chromium-crosswalk,markYoungH/chromium.src,M4sse/chromium.src,ondra-novak/chromium.src,Fireblend/chromium-crosswalk,mogoweb/chromium-crosswalk,mogoweb/chromium-crosswalk,Just-D/chromium-1,chuan9/chromium-crosswalk,littlstar/chromium.src,hgl888/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,axinging/chromium-crosswalk,Chilledheart/chromium,timopulkkinen/BubbleFish,Fireblend/chromium-crosswalk,Fireblend/chromium-crosswalk,mogoweb/chromium-crosswalk,Pluto-tv/chromium-crosswalk,ltilve/chromium,Fireblend/chromium-crosswalk,jaruba/chromium.src,ltilve/chromium,ChromiumWebApps/chromium,dednal/chromium.src,crosswalk-project/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,Jonekee/chromium.src,timopulkkinen/BubbleFish,dushu1203/chromium.src,mogoweb/chromium-crosswalk,dednal/chromium.src,pozdnyakov/chromium-crosswalk,dednal/chromium.src,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,Chilledheart/chromium,dushu1203/chromium.src,pozdnyakov/chromium-crosswalk,dednal/chromium.src,M4sse/chromium.src,anirudhSK/chromium,dednal/chromium.src,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,markYoungH/chromium.src,timopulkkinen/BubbleFish,Chilledheart/chromium,M4sse/chromium.src,ondra-novak/chromium.src,Jonekee/chromium.src,Jonekee/chromium.src,ltilve/chromium,Jonekee/chromium.src,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,ChromiumWebApps/chromium,pozdnyakov/chromium-crosswalk,hujiajie/pa-chromium,fujunwei/chromium-crosswalk,patrickm/chromium.src,hujiajie/pa-chromium,Fireblend/chromium-crosswalk,patrickm/chromium.src,ondra-novak/chromium.src,Just-D/chromium-1,axinging/chromium-crosswalk,anirudhSK/chromium,patrickm/chromium.src,TheTypoMaster/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,anirudhSK/chromium,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,jaruba/chromium.src,Pluto-tv/chromium-crosswalk,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk-efl,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,Just-D/chromium-1,dednal/chromium.src,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,patrickm/chromium.src,ChromiumWebApps/chromium,ChromiumWebApps/chromium,M4sse/chromium.src,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,anirudhSK/chromium,hgl888/chromium-crosswalk,timopulkkinen/BubbleFish,pozdnyakov/chromium-crosswalk,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,timopulkkinen/BubbleFish,Chilledheart/chromium,jaruba/chromium.src,M4sse/chromium.src,dushu1203/chromium.src,ChromiumWebApps/chromium,hujiajie/pa-chromium,PeterWangIntel/chromium-crosswalk,littlstar/chromium.src,ltilve/chromium,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,M4sse/chromium.src,ondra-novak/chromium.src,mohamed--abdel-maksoud/chromium.src,patrickm/chromium.src,hujiajie/pa-chromium,hgl888/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,Pluto-tv/chromium-crosswalk,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src