anchor.diff:  = Tracking tests' network statistics with Docker
   :hp-tags: browsermob-proxy, webdriver, allure, docker, harviewer, java, testng
   :published_at: 2016-07-18
  -==== Browsermob Proxy Docker image
  +== Browsermob Proxy Docker image
   To be able to use the following example, you'll need to build link:https://github.com/sskorol/docker-browsermob-proxy[docker-browsermob-proxy^] first. This base Docker image contains latest (2.1.1) link:https://github.com/lightbody/browsermob-proxy[Browsermob Proxy (BMP)] version.
  -==== Docker configuration
  +== Docker configuration
   Raising newly built image would be quite simple with a help of `docker-compose`. Here's a sample BMP / Selenium Grid configuration, which will help you to link all containers together:
   [source,YAML]
   ----
  
positive.code:  - chromenode:node_ch
  ----
  If you missed my link:http://qa-automation-notes.blogspot.com/2016/04/docker-selenium-and-bit-of-allure-how.html[article] about `docker-selenium` customization, you can pull above images from appropriate link:https://github.com/sskorol/docker-selenium[fork].
  ==== HAR viewer
  To provide extensive network statistics in test results reports, we'll use one of the best link:http://www.softwareishard.com/blog/har-viewer[HAR Viewer], which supports really nice embedded mode.
  
  Java implementation requires both front-end and backend involvement. You may already know that link:http://allure.qatools.ru[Allure] supports `html` attachments. To be able to use embedded HAR Viewer, we need to create our own template first. This could be done using link:https://github.com/spullara/mustache.java[mustache] library.
  
negative.code: 	return new Proxy().setHttpProxy(actualProxy).setFtpProxy(actualProxy).setSslProxy(actualProxy);
  }
  ----
  == HAR files processing
  Depending on proxy server location, network configuration and HAR size, it could take long to retrieve recorded network statistics. To avoid wasting time on HAR processing, we'll supply it async via `CompletableFuture`.
  [source,java]
  ----
  