1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
open! Import
include Progress_engine_intf
module type Platform = Platform.S
module Make (Platform : Platform) = struct
module Color = Terminal.Color
module Duration = Duration
module Multi = Multi
module Printer = Printer
module Units = Units
module Internals = struct
module Ansi = Terminal.Style
end
module Config = struct
include Config
type t = user_supplied
end
module Renderer = struct
include Renderer.Make (Platform)
include Renderer
end
module Line = struct
include Line.Make (Platform)
include Line
end
module Display = Renderer.Display
module Reporter = Renderer.Reporter
let counter ?(style = `ASCII) ?message ?pp total =
let map_option ~f x = Option.fold ~none:(Line.noop ()) ~some:f x in
let open Line.Using_int64 in
list
[ map_option message ~f:const
; map_option pp ~f:(fun pp -> sum ~pp ~width:(Printer.print_width pp) ())
; elapsed ()
; bar ~style total
; percentage_of total
]
let interject_with = Renderer.interject_with
let instrument_logs_reporter = Renderer.instrument_logs_reporter
let logs_reporter = Renderer.logs_reporter
let with_reporters = Renderer.with_reporters
let with_reporter ?config b f = with_reporters ?config (Multi.line b) f
end
module Integer = Integer
module Exposed_for_testing = struct
module Flow_meter = Flow_meter
end