anchor.diff:  http_request_duration_milliseconds_count{method=\"get\"} 9
   http_request_duration_milliseconds_sum{method=\"get\"} 2622
   
  -",
  -                binary_to_list(prometheus_text_format:format())).
  +">>, prometheus_text_format:format()).
  +
  +test_dhistogram(_) ->
  +  prometheus_histogram:new([{name, http_request_duration_milliseconds},
  +                            {labels, [method]},
  +                            {bounds, [100, 300, 500, 750, 1000]},
  +                            {help, "Http Request execution time"}]),
  +  prometheus_histogram:dobserve(http_request_duration_milliseconds, [post], 500.2),
  +  prometheus_histogram:dobserve(http_request_duration_milliseconds, [post], 150.4),
  +  prometheus_histogram:dobserve(http_request_duration_milliseconds, [post], 450.5),
  +  prometheus_histogram:dobserve(http_request_duration_milliseconds, [post], 850.3),
  +  prometheus_histogram:dobserve(http_request_duration_milliseconds, [post], 750.9),
  +  prometheus_histogram:dobserve(http_request_duration_milliseconds, [post], 1650.23),
  +  ?_assertEqual(<<"# TYPE http_request_duration_milliseconds histogram
  +# HELP http_request_duration_milliseconds Http Request execution time
  +http_request_duration_milliseconds_bucket{method=\"post\",le=\"100\"} 0
  +http_request_duration_milliseconds_bucket{method=\"post\",le=\"300\"} 1
  +http_request_duration_milliseconds_bucket{method=\"post\",le=\"500\"} 2
  +http_request_duration_milliseconds_bucket{method=\"post\",le=\"750\"} 3
  +http_request_duration_milliseconds_bucket{method=\"post\",le=\"1000\"} 5
  +http_request_duration_milliseconds_bucket{method=\"post\",le=\"+Inf\"} 6
  +http_request_duration_milliseconds_count{method=\"post\"} 6
  +http_request_duration_milliseconds_sum{method=\"post\"} 4352.53
  +
  +">>, prometheus_text_format:format()).
  
positive.code:   prometheus_histogram:observe(http_request_duration_milliseconds, [get], 350),
    prometheus_histogram:observe(http_request_duration_milliseconds, [get], 550),
    prometheus_histogram:observe(http_request_duration_milliseconds, [get], 950),
    prometheus_histogram:observe(http_request_duration_milliseconds, [post], 500),
    prometheus_histogram:observe(http_request_duration_milliseconds, [post], 150),
    prometheus_histogram:observe(http_request_duration_milliseconds, [post], 450),
    prometheus_histogram:observe(http_request_duration_milliseconds, [post], 850),
    prometheus_histogram:observe(http_request_duration_milliseconds, [post], 750),
    prometheus_histogram:observe(http_request_duration_milliseconds, [post], 1650),
    prometheus_counter:dinc(dtest, 1.5),
    prometheus_counter:dinc(dtest, 3.5),
    prometheus_counter:dinc(dtest, 1.5),
    ?_assertEqual("# TYPE pool_size gauge
  # HELP pool_size MongoDB Connections pool size
  pool_size 365
  # TYPE http_requests_total counter
  # HELP http_requests_total Http request count
  http_requests_total 1
  # TYPE dtest counter
  # HELP dtest qwe
  dtest 6.5
  # TYPE orders_summary summary
  # HELP orders_summary Track orders count/total sum
  orders_summary_count 2
  orders_summary_sum 25
  # TYPE dsummary summary
  # HELP dsummary qwe
  dsummary_count 2
  dsummary_sum 4.2
  # TYPE http_request_duration_milliseconds histogram
  # HELP http_request_duration_milliseconds Http Request execution time
  http_request_duration_milliseconds_bucket{method=\"post\",le=\"100\"} 0
  http_request_duration_milliseconds_bucket{method=\"post\",le=\"300\"} 1
  http_request_duration_milliseconds_bucket{method=\"post\",le=\"500\"} 3
  http_request_duration_milliseconds_bucket{method=\"post\",le=\"750\"} 4
  http_request_duration_milliseconds_bucket{method=\"post\",le=\"1000\"} 5
  http_request_duration_milliseconds_bucket{method=\"post\",le=\"+Inf\"} 6
  http_request_duration_milliseconds_count{method=\"post\"} 6
  http_request_duration_milliseconds_sum{method=\"post\"} 4350
  http_request_duration_milliseconds_bucket{method=\"get\",le=\"100\"} 3
  http_request_duration_milliseconds_bucket{method=\"get\",le=\"300\"} 6
  http_request_duration_milliseconds_bucket{method=\"get\",le=\"500\"} 7
  
negative.code:   ?assertEqual("qwe\\\\qwe\\nqwe\\\"qwe", prometheus_text_format:escape_label_value("qwe\\qwe\nqwe\"qwe")).
  
  prometheus_format_test_() ->
    {foreach,
     fun start/0,
     fun stop/1,
     [fun test_gauge/1,
      fun test_counter/1,
      fun test_dcounter/1,
      fun test_summary/1,
      fun test_dsummary/1,
      fun test_histogram/1,
      fun test_dhistogram/1]}.
  
  start() ->
    prometheus:start(),
  