karafka-web 0.6.3 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (214) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/.github/workflows/ci.yml +13 -4
  4. data/CHANGELOG.md +119 -5
  5. data/Gemfile +1 -0
  6. data/Gemfile.lock +27 -24
  7. data/README.md +2 -0
  8. data/bin/rspecs +6 -0
  9. data/certs/cert_chain.pem +21 -21
  10. data/docker-compose.yml +22 -0
  11. data/karafka-web.gemspec +3 -3
  12. data/lib/karafka/web/app.rb +6 -2
  13. data/lib/karafka/web/cli.rb +51 -47
  14. data/lib/karafka/web/config.rb +33 -9
  15. data/lib/karafka/web/contracts/base.rb +32 -0
  16. data/lib/karafka/web/contracts/config.rb +63 -0
  17. data/lib/karafka/web/deserializer.rb +10 -1
  18. data/lib/karafka/web/errors.rb +29 -7
  19. data/lib/karafka/web/installer.rb +58 -148
  20. data/lib/karafka/web/management/base.rb +34 -0
  21. data/lib/karafka/web/management/clean_boot_file.rb +31 -0
  22. data/lib/karafka/web/management/create_initial_states.rb +101 -0
  23. data/lib/karafka/web/management/create_topics.rb +127 -0
  24. data/lib/karafka/web/management/delete_topics.rb +28 -0
  25. data/lib/karafka/web/management/enable.rb +82 -0
  26. data/lib/karafka/web/management/extend_boot_file.rb +37 -0
  27. data/lib/karafka/web/processing/consumer.rb +73 -17
  28. data/lib/karafka/web/processing/consumers/aggregators/base.rb +56 -0
  29. data/lib/karafka/web/processing/consumers/aggregators/metrics.rb +154 -0
  30. data/lib/karafka/web/processing/consumers/aggregators/state.rb +180 -0
  31. data/lib/karafka/web/processing/consumers/contracts/aggregated_stats.rb +32 -0
  32. data/lib/karafka/web/processing/consumers/contracts/metrics.rb +53 -0
  33. data/lib/karafka/web/processing/consumers/contracts/process.rb +19 -0
  34. data/lib/karafka/web/processing/consumers/contracts/state.rb +49 -0
  35. data/lib/karafka/web/processing/consumers/contracts/topic_stats.rb +21 -0
  36. data/lib/karafka/web/processing/consumers/metrics.rb +29 -0
  37. data/lib/karafka/web/processing/consumers/schema_manager.rb +56 -0
  38. data/lib/karafka/web/processing/consumers/state.rb +6 -9
  39. data/lib/karafka/web/processing/time_series_tracker.rb +130 -0
  40. data/lib/karafka/web/tracking/consumers/contracts/consumer_group.rb +2 -2
  41. data/lib/karafka/web/tracking/consumers/contracts/job.rb +2 -1
  42. data/lib/karafka/web/tracking/consumers/contracts/partition.rb +14 -1
  43. data/lib/karafka/web/tracking/consumers/contracts/report.rb +10 -8
  44. data/lib/karafka/web/tracking/consumers/contracts/subscription_group.rb +2 -2
  45. data/lib/karafka/web/tracking/consumers/contracts/topic.rb +2 -2
  46. data/lib/karafka/web/tracking/consumers/listeners/processing.rb +6 -2
  47. data/lib/karafka/web/tracking/consumers/listeners/statistics.rb +15 -1
  48. data/lib/karafka/web/tracking/consumers/reporter.rb +14 -6
  49. data/lib/karafka/web/tracking/consumers/sampler.rb +80 -39
  50. data/lib/karafka/web/tracking/contracts/error.rb +2 -1
  51. data/lib/karafka/web/ui/app.rb +20 -10
  52. data/lib/karafka/web/ui/base.rb +56 -6
  53. data/lib/karafka/web/ui/controllers/base.rb +28 -0
  54. data/lib/karafka/web/ui/controllers/become_pro.rb +1 -1
  55. data/lib/karafka/web/ui/controllers/cluster.rb +12 -6
  56. data/lib/karafka/web/ui/controllers/consumers.rb +4 -2
  57. data/lib/karafka/web/ui/controllers/dashboard.rb +32 -0
  58. data/lib/karafka/web/ui/controllers/errors.rb +19 -6
  59. data/lib/karafka/web/ui/controllers/jobs.rb +4 -2
  60. data/lib/karafka/web/ui/controllers/requests/params.rb +28 -0
  61. data/lib/karafka/web/ui/controllers/responses/redirect.rb +29 -0
  62. data/lib/karafka/web/ui/helpers/application_helper.rb +57 -14
  63. data/lib/karafka/web/ui/helpers/paths_helper.rb +48 -0
  64. data/lib/karafka/web/ui/lib/hash_proxy.rb +18 -6
  65. data/lib/karafka/web/ui/lib/paginations/base.rb +61 -0
  66. data/lib/karafka/web/ui/lib/paginations/offset_based.rb +96 -0
  67. data/lib/karafka/web/ui/lib/paginations/page_based.rb +70 -0
  68. data/lib/karafka/web/ui/lib/paginations/paginators/arrays.rb +33 -0
  69. data/lib/karafka/web/ui/lib/paginations/paginators/base.rb +23 -0
  70. data/lib/karafka/web/ui/lib/paginations/paginators/partitions.rb +52 -0
  71. data/lib/karafka/web/ui/lib/paginations/paginators/sets.rb +85 -0
  72. data/lib/karafka/web/ui/lib/paginations/watermark_offsets_based.rb +75 -0
  73. data/lib/karafka/web/ui/lib/ttl_cache.rb +82 -0
  74. data/lib/karafka/web/ui/models/cluster_info.rb +59 -0
  75. data/lib/karafka/web/ui/models/consumers_metrics.rb +46 -0
  76. data/lib/karafka/web/ui/models/{state.rb → consumers_state.rb} +6 -2
  77. data/lib/karafka/web/ui/models/health.rb +37 -7
  78. data/lib/karafka/web/ui/models/message.rb +123 -39
  79. data/lib/karafka/web/ui/models/metrics/aggregated.rb +196 -0
  80. data/lib/karafka/web/ui/models/metrics/charts/aggregated.rb +50 -0
  81. data/lib/karafka/web/ui/models/metrics/charts/topics.rb +109 -0
  82. data/lib/karafka/web/ui/models/metrics/topics.rb +101 -0
  83. data/lib/karafka/web/ui/models/partition.rb +27 -0
  84. data/lib/karafka/web/ui/models/process.rb +12 -1
  85. data/lib/karafka/web/ui/models/status.rb +110 -22
  86. data/lib/karafka/web/ui/models/visibility_filter.rb +33 -0
  87. data/lib/karafka/web/ui/pro/app.rb +87 -19
  88. data/lib/karafka/web/ui/pro/controllers/cluster.rb +11 -0
  89. data/lib/karafka/web/ui/pro/controllers/consumers.rb +13 -7
  90. data/lib/karafka/web/ui/pro/controllers/dashboard.rb +54 -0
  91. data/lib/karafka/web/ui/pro/controllers/dlq.rb +1 -2
  92. data/lib/karafka/web/ui/pro/controllers/errors.rb +46 -10
  93. data/lib/karafka/web/ui/pro/controllers/explorer.rb +145 -15
  94. data/lib/karafka/web/ui/pro/controllers/health.rb +10 -2
  95. data/lib/karafka/web/ui/pro/controllers/messages.rb +62 -0
  96. data/lib/karafka/web/ui/pro/controllers/routing.rb +44 -0
  97. data/lib/karafka/web/ui/pro/views/consumers/_breadcrumbs.erb +7 -1
  98. data/lib/karafka/web/ui/pro/views/consumers/_consumer.erb +1 -1
  99. data/lib/karafka/web/ui/pro/views/consumers/_counters.erb +7 -5
  100. data/lib/karafka/web/ui/pro/views/consumers/consumer/_job.erb +3 -3
  101. data/lib/karafka/web/ui/pro/views/consumers/consumer/_metrics.erb +5 -4
  102. data/lib/karafka/web/ui/pro/views/consumers/consumer/_partition.erb +13 -4
  103. data/lib/karafka/web/ui/pro/views/consumers/consumer/_subscription_group.erb +3 -2
  104. data/lib/karafka/web/ui/pro/views/consumers/consumer/_tabs.erb +7 -0
  105. data/lib/karafka/web/ui/pro/views/consumers/details.erb +21 -0
  106. data/lib/karafka/web/ui/pro/views/consumers/index.erb +4 -2
  107. data/lib/karafka/web/ui/pro/views/dashboard/_ranges_selector.erb +39 -0
  108. data/lib/karafka/web/ui/pro/views/dashboard/index.erb +82 -0
  109. data/lib/karafka/web/ui/pro/views/dlq/_topic.erb +1 -1
  110. data/lib/karafka/web/ui/pro/views/errors/_breadcrumbs.erb +8 -6
  111. data/lib/karafka/web/ui/pro/views/errors/_error.erb +2 -2
  112. data/lib/karafka/web/ui/pro/views/errors/_partition_option.erb +1 -1
  113. data/lib/karafka/web/ui/pro/views/errors/_table.erb +21 -0
  114. data/lib/karafka/web/ui/pro/views/errors/_title_with_select.erb +31 -0
  115. data/lib/karafka/web/ui/pro/views/errors/index.erb +9 -56
  116. data/lib/karafka/web/ui/pro/views/errors/partition.erb +17 -0
  117. data/lib/karafka/web/ui/pro/views/errors/show.erb +1 -1
  118. data/lib/karafka/web/ui/pro/views/explorer/_breadcrumbs.erb +6 -4
  119. data/lib/karafka/web/ui/pro/views/explorer/_filtered.erb +16 -0
  120. data/lib/karafka/web/ui/pro/views/explorer/_message.erb +14 -4
  121. data/lib/karafka/web/ui/pro/views/explorer/_no_topics.erb +7 -0
  122. data/lib/karafka/web/ui/pro/views/explorer/_partition_option.erb +3 -3
  123. data/lib/karafka/web/ui/pro/views/explorer/_topic.erb +1 -1
  124. data/lib/karafka/web/ui/pro/views/explorer/index.erb +12 -8
  125. data/lib/karafka/web/ui/pro/views/explorer/messages/_headers.erb +15 -0
  126. data/lib/karafka/web/ui/pro/views/explorer/messages/_key.erb +12 -0
  127. data/lib/karafka/web/ui/pro/views/explorer/partition/_details.erb +35 -0
  128. data/lib/karafka/web/ui/pro/views/explorer/partition/_messages.erb +1 -0
  129. data/lib/karafka/web/ui/pro/views/explorer/partition.erb +6 -4
  130. data/lib/karafka/web/ui/pro/views/explorer/show.erb +48 -5
  131. data/lib/karafka/web/ui/pro/views/explorer/topic/_details.erb +23 -0
  132. data/lib/karafka/web/ui/pro/views/explorer/topic/_empty.erb +3 -0
  133. data/lib/karafka/web/ui/pro/views/explorer/topic/_limited.erb +4 -0
  134. data/lib/karafka/web/ui/pro/views/explorer/topic.erb +51 -0
  135. data/lib/karafka/web/ui/pro/views/health/_breadcrumbs.erb +16 -0
  136. data/lib/karafka/web/ui/pro/views/health/_no_data.erb +9 -0
  137. data/lib/karafka/web/ui/pro/views/health/_partition.erb +17 -15
  138. data/lib/karafka/web/ui/pro/views/health/_partition_offset.erb +40 -0
  139. data/lib/karafka/web/ui/pro/views/health/_tabs.erb +27 -0
  140. data/lib/karafka/web/ui/pro/views/health/offsets.erb +71 -0
  141. data/lib/karafka/web/ui/pro/views/health/overview.erb +68 -0
  142. data/lib/karafka/web/ui/pro/views/jobs/_job.erb +6 -3
  143. data/lib/karafka/web/ui/pro/views/jobs/index.erb +4 -1
  144. data/lib/karafka/web/ui/pro/views/routing/_consumer_group.erb +37 -0
  145. data/lib/karafka/web/ui/pro/views/routing/_detail.erb +25 -0
  146. data/lib/karafka/web/ui/pro/views/routing/_topic.erb +23 -0
  147. data/lib/karafka/web/ui/pro/views/routing/index.erb +10 -0
  148. data/lib/karafka/web/ui/pro/views/routing/show.erb +26 -0
  149. data/lib/karafka/web/ui/pro/views/shared/_navigation.erb +7 -10
  150. data/lib/karafka/web/ui/public/images/logo-gray.svg +28 -0
  151. data/lib/karafka/web/ui/public/javascripts/application.js +30 -0
  152. data/lib/karafka/web/ui/public/javascripts/chart.min.js +14 -0
  153. data/lib/karafka/web/ui/public/javascripts/charts.js +330 -0
  154. data/lib/karafka/web/ui/public/javascripts/datepicker.js +6 -0
  155. data/lib/karafka/web/ui/public/javascripts/live_poll.js +39 -12
  156. data/lib/karafka/web/ui/public/javascripts/offset_datetime.js +74 -0
  157. data/lib/karafka/web/ui/public/javascripts/tabs.js +59 -0
  158. data/lib/karafka/web/ui/public/stylesheets/application.css +11 -0
  159. data/lib/karafka/web/ui/public/stylesheets/datepicker.min.css +12 -0
  160. data/lib/karafka/web/ui/views/cluster/_no_partitions.erb +3 -0
  161. data/lib/karafka/web/ui/views/cluster/_partition.erb +20 -22
  162. data/lib/karafka/web/ui/views/cluster/index.erb +6 -1
  163. data/lib/karafka/web/ui/views/consumers/_consumer.erb +1 -1
  164. data/lib/karafka/web/ui/views/consumers/_counters.erb +6 -4
  165. data/lib/karafka/web/ui/views/consumers/_summary.erb +3 -3
  166. data/lib/karafka/web/ui/views/consumers/index.erb +3 -1
  167. data/lib/karafka/web/ui/views/dashboard/_feature_pro.erb +3 -0
  168. data/lib/karafka/web/ui/views/dashboard/_not_enough_data.erb +15 -0
  169. data/lib/karafka/web/ui/views/dashboard/_ranges_selector.erb +23 -0
  170. data/lib/karafka/web/ui/views/dashboard/index.erb +95 -0
  171. data/lib/karafka/web/ui/views/errors/_detail.erb +12 -0
  172. data/lib/karafka/web/ui/views/errors/_error.erb +2 -2
  173. data/lib/karafka/web/ui/views/errors/show.erb +1 -1
  174. data/lib/karafka/web/ui/views/jobs/index.erb +3 -1
  175. data/lib/karafka/web/ui/views/layout.erb +10 -3
  176. data/lib/karafka/web/ui/views/routing/_consumer_group.erb +8 -6
  177. data/lib/karafka/web/ui/views/routing/_detail.erb +2 -2
  178. data/lib/karafka/web/ui/views/routing/_topic.erb +1 -1
  179. data/lib/karafka/web/ui/views/routing/show.erb +1 -1
  180. data/lib/karafka/web/ui/views/shared/_brand.erb +2 -2
  181. data/lib/karafka/web/ui/views/shared/_chart.erb +14 -0
  182. data/lib/karafka/web/ui/views/shared/_content.erb +2 -2
  183. data/lib/karafka/web/ui/views/shared/_feature_pro.erb +1 -1
  184. data/lib/karafka/web/ui/views/shared/_flashes.erb +9 -0
  185. data/lib/karafka/web/ui/views/shared/_footer.erb +22 -0
  186. data/lib/karafka/web/ui/views/shared/_header.erb +15 -9
  187. data/lib/karafka/web/ui/views/shared/_live_poll.erb +7 -0
  188. data/lib/karafka/web/ui/views/shared/_navigation.erb +5 -8
  189. data/lib/karafka/web/ui/views/shared/_no_paginated_data.erb +9 -0
  190. data/lib/karafka/web/ui/views/shared/_pagination.erb +17 -13
  191. data/lib/karafka/web/ui/views/shared/_tab_nav.erb +7 -0
  192. data/lib/karafka/web/ui/views/shared/exceptions/not_found.erb +34 -32
  193. data/lib/karafka/web/ui/views/shared/exceptions/pro_only.erb +45 -43
  194. data/lib/karafka/web/ui/views/status/failures/_consumers_reports_schema_state.erb +15 -0
  195. data/lib/karafka/web/ui/views/status/failures/_enabled.erb +8 -0
  196. data/lib/karafka/web/ui/views/status/failures/_initial_consumers_metrics.erb +11 -0
  197. data/lib/karafka/web/ui/views/status/failures/{_initial_state.erb → _initial_consumers_state.erb} +3 -3
  198. data/lib/karafka/web/ui/views/status/failures/_partitions.erb +14 -6
  199. data/lib/karafka/web/ui/views/status/info/_components.erb +21 -1
  200. data/lib/karafka/web/ui/views/status/show.erb +62 -5
  201. data/lib/karafka/web/ui/views/status/successes/_enabled.erb +1 -0
  202. data/lib/karafka/web/ui/views/status/warnings/_replication.erb +19 -0
  203. data/lib/karafka/web/version.rb +1 -1
  204. data/lib/karafka/web.rb +11 -0
  205. data.tar.gz.sig +0 -0
  206. metadata +124 -39
  207. metadata.gz.sig +0 -0
  208. data/lib/karafka/web/processing/consumers/aggregator.rb +0 -130
  209. data/lib/karafka/web/tracking/contracts/base.rb +0 -34
  210. data/lib/karafka/web/ui/lib/paginate_array.rb +0 -38
  211. data/lib/karafka/web/ui/pro/views/explorer/_encryption_enabled.erb +0 -18
  212. data/lib/karafka/web/ui/pro/views/explorer/partition/_watermark_offsets.erb +0 -10
  213. data/lib/karafka/web/ui/pro/views/health/index.erb +0 -60
  214. /data/lib/karafka/web/ui/pro/views/explorer/{_detail.erb → messages/_detail.erb} +0 -0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karafka-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -12,30 +12,30 @@ cert_chain:
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MRAwDgYDVQQDDAdjb250
14
14
  YWN0MRcwFQYKCZImiZPyLGQBGRYHa2FyYWZrYTESMBAGCgmSJomT8ixkARkWAmlv
15
- MB4XDTIyMDgxOTE3MjEzN1oXDTIzMDgxOTE3MjEzN1owPzEQMA4GA1UEAwwHY29u
15
+ MB4XDTIzMDgyMTA3MjU1NFoXDTI0MDgyMDA3MjU1NFowPzEQMA4GA1UEAwwHY29u
16
16
  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
- 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
- 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
- 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
- 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
- lTCvnKk284F6QZq5XIENLRmcDd/3aPBLnLwNnyMyhB+6gK8cUO+CFlDO5tjo/aBA
22
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- Q0P8zeBi4OfwCZNcxqz0KONmw9JLNv6DgyEAH5xe/4JzhMEgvIRiPj0pHfA7oqQF
34
- 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
- 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
- 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
37
37
  -----END CERTIFICATE-----
38
- date: 2023-07-22 00:00:00.000000000 Z
38
+ date: 2023-09-14 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: erubi
@@ -57,7 +57,7 @@ dependencies:
57
57
  requirements:
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
- version: 2.1.4
60
+ version: 2.2.3
61
61
  - - "<"
62
62
  - !ruby/object:Gem::Version
63
63
  version: 3.0.0
@@ -67,7 +67,7 @@ dependencies:
67
67
  requirements:
68
68
  - - ">="
69
69
  - !ruby/object:Gem::Version
70
- version: 2.1.4
70
+ version: 2.2.3
71
71
  - - "<"
72
72
  - !ruby/object:Gem::Version
73
73
  version: 3.0.0
@@ -77,7 +77,7 @@ dependencies:
77
77
  requirements:
78
78
  - - ">="
79
79
  - !ruby/object:Gem::Version
80
- version: 2.0.13
80
+ version: 2.2.2
81
81
  - - "<"
82
82
  - !ruby/object:Gem::Version
83
83
  version: 3.0.0
@@ -87,7 +87,7 @@ dependencies:
87
87
  requirements:
88
88
  - - ">="
89
89
  - !ruby/object:Gem::Version
90
- version: 2.0.13
90
+ version: 2.2.2
91
91
  - - "<"
92
92
  - !ruby/object:Gem::Version
93
93
  version: 3.0.0
@@ -100,7 +100,7 @@ dependencies:
100
100
  version: '3.68'
101
101
  - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: '3.68'
103
+ version: '3.69'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
@@ -110,7 +110,7 @@ dependencies:
110
110
  version: '3.68'
111
111
  - - ">="
112
112
  - !ruby/object:Gem::Version
113
- version: '3.68'
113
+ version: '3.69'
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: tilt
116
116
  requirement: !ruby/object:Gem::Requirement
@@ -164,19 +164,40 @@ files:
164
164
  - LICENSE
165
165
  - README.md
166
166
  - bin/karafka-web
167
+ - bin/rspecs
167
168
  - certs/cert_chain.pem
168
169
  - config/locales/errors.yml
170
+ - docker-compose.yml
169
171
  - karafka-web.gemspec
170
172
  - lib/karafka/web.rb
171
173
  - lib/karafka/web/app.rb
172
174
  - lib/karafka/web/cli.rb
173
175
  - lib/karafka/web/config.rb
176
+ - lib/karafka/web/contracts/base.rb
177
+ - lib/karafka/web/contracts/config.rb
174
178
  - lib/karafka/web/deserializer.rb
175
179
  - lib/karafka/web/errors.rb
176
180
  - lib/karafka/web/installer.rb
181
+ - lib/karafka/web/management/base.rb
182
+ - lib/karafka/web/management/clean_boot_file.rb
183
+ - lib/karafka/web/management/create_initial_states.rb
184
+ - lib/karafka/web/management/create_topics.rb
185
+ - lib/karafka/web/management/delete_topics.rb
186
+ - lib/karafka/web/management/enable.rb
187
+ - lib/karafka/web/management/extend_boot_file.rb
177
188
  - lib/karafka/web/processing/consumer.rb
178
- - lib/karafka/web/processing/consumers/aggregator.rb
189
+ - lib/karafka/web/processing/consumers/aggregators/base.rb
190
+ - lib/karafka/web/processing/consumers/aggregators/metrics.rb
191
+ - lib/karafka/web/processing/consumers/aggregators/state.rb
192
+ - lib/karafka/web/processing/consumers/contracts/aggregated_stats.rb
193
+ - lib/karafka/web/processing/consumers/contracts/metrics.rb
194
+ - lib/karafka/web/processing/consumers/contracts/process.rb
195
+ - lib/karafka/web/processing/consumers/contracts/state.rb
196
+ - lib/karafka/web/processing/consumers/contracts/topic_stats.rb
197
+ - lib/karafka/web/processing/consumers/metrics.rb
198
+ - lib/karafka/web/processing/consumers/schema_manager.rb
179
199
  - lib/karafka/web/processing/consumers/state.rb
200
+ - lib/karafka/web/processing/time_series_tracker.rb
180
201
  - lib/karafka/web/tracking/consumers/contracts/consumer_group.rb
181
202
  - lib/karafka/web/tracking/consumers/contracts/job.rb
182
203
  - lib/karafka/web/tracking/consumers/contracts/partition.rb
@@ -192,7 +213,6 @@ files:
192
213
  - lib/karafka/web/tracking/consumers/listeners/tags.rb
193
214
  - lib/karafka/web/tracking/consumers/reporter.rb
194
215
  - lib/karafka/web/tracking/consumers/sampler.rb
195
- - lib/karafka/web/tracking/contracts/base.rb
196
216
  - lib/karafka/web/tracking/contracts/error.rb
197
217
  - lib/karafka/web/tracking/helpers/error_info.rb
198
218
  - lib/karafka/web/tracking/memoized_shell.rb
@@ -210,36 +230,56 @@ files:
210
230
  - lib/karafka/web/ui/controllers/become_pro.rb
211
231
  - lib/karafka/web/ui/controllers/cluster.rb
212
232
  - lib/karafka/web/ui/controllers/consumers.rb
233
+ - lib/karafka/web/ui/controllers/dashboard.rb
213
234
  - lib/karafka/web/ui/controllers/errors.rb
214
235
  - lib/karafka/web/ui/controllers/jobs.rb
215
236
  - lib/karafka/web/ui/controllers/requests/params.rb
216
237
  - lib/karafka/web/ui/controllers/responses/data.rb
238
+ - lib/karafka/web/ui/controllers/responses/redirect.rb
217
239
  - lib/karafka/web/ui/controllers/routing.rb
218
240
  - lib/karafka/web/ui/controllers/status.rb
219
241
  - lib/karafka/web/ui/helpers/application_helper.rb
242
+ - lib/karafka/web/ui/helpers/paths_helper.rb
220
243
  - lib/karafka/web/ui/lib/hash_proxy.rb
221
- - lib/karafka/web/ui/lib/paginate_array.rb
244
+ - lib/karafka/web/ui/lib/paginations/base.rb
245
+ - lib/karafka/web/ui/lib/paginations/offset_based.rb
246
+ - lib/karafka/web/ui/lib/paginations/page_based.rb
247
+ - lib/karafka/web/ui/lib/paginations/paginators/arrays.rb
248
+ - lib/karafka/web/ui/lib/paginations/paginators/base.rb
249
+ - lib/karafka/web/ui/lib/paginations/paginators/partitions.rb
250
+ - lib/karafka/web/ui/lib/paginations/paginators/sets.rb
251
+ - lib/karafka/web/ui/lib/paginations/watermark_offsets_based.rb
252
+ - lib/karafka/web/ui/lib/ttl_cache.rb
253
+ - lib/karafka/web/ui/models/cluster_info.rb
222
254
  - lib/karafka/web/ui/models/consumer_group.rb
255
+ - lib/karafka/web/ui/models/consumers_metrics.rb
256
+ - lib/karafka/web/ui/models/consumers_state.rb
223
257
  - lib/karafka/web/ui/models/counters.rb
224
258
  - lib/karafka/web/ui/models/health.rb
225
259
  - lib/karafka/web/ui/models/job.rb
226
260
  - lib/karafka/web/ui/models/message.rb
261
+ - lib/karafka/web/ui/models/metrics/aggregated.rb
262
+ - lib/karafka/web/ui/models/metrics/charts/aggregated.rb
263
+ - lib/karafka/web/ui/models/metrics/charts/topics.rb
264
+ - lib/karafka/web/ui/models/metrics/topics.rb
227
265
  - lib/karafka/web/ui/models/partition.rb
228
266
  - lib/karafka/web/ui/models/process.rb
229
267
  - lib/karafka/web/ui/models/processes.rb
230
- - lib/karafka/web/ui/models/state.rb
231
268
  - lib/karafka/web/ui/models/status.rb
232
269
  - lib/karafka/web/ui/models/subscription_group.rb
233
270
  - lib/karafka/web/ui/models/topic.rb
271
+ - lib/karafka/web/ui/models/visibility_filter.rb
234
272
  - lib/karafka/web/ui/models/watermark_offsets.rb
235
273
  - lib/karafka/web/ui/pro/app.rb
236
274
  - lib/karafka/web/ui/pro/controllers/cluster.rb
237
275
  - lib/karafka/web/ui/pro/controllers/consumers.rb
276
+ - lib/karafka/web/ui/pro/controllers/dashboard.rb
238
277
  - lib/karafka/web/ui/pro/controllers/dlq.rb
239
278
  - lib/karafka/web/ui/pro/controllers/errors.rb
240
279
  - lib/karafka/web/ui/pro/controllers/explorer.rb
241
280
  - lib/karafka/web/ui/pro/controllers/health.rb
242
281
  - lib/karafka/web/ui/pro/controllers/jobs.rb
282
+ - lib/karafka/web/ui/pro/controllers/messages.rb
243
283
  - lib/karafka/web/ui/pro/controllers/routing.rb
244
284
  - lib/karafka/web/ui/pro/controllers/status.rb
245
285
  - lib/karafka/web/ui/pro/views/consumers/_breadcrumbs.erb
@@ -254,9 +294,12 @@ files:
254
294
  - lib/karafka/web/ui/pro/views/consumers/consumer/_stopped.erb
255
295
  - lib/karafka/web/ui/pro/views/consumers/consumer/_subscription_group.erb
256
296
  - lib/karafka/web/ui/pro/views/consumers/consumer/_tabs.erb
297
+ - lib/karafka/web/ui/pro/views/consumers/details.erb
257
298
  - lib/karafka/web/ui/pro/views/consumers/index.erb
258
299
  - lib/karafka/web/ui/pro/views/consumers/jobs.erb
259
300
  - lib/karafka/web/ui/pro/views/consumers/subscriptions.erb
301
+ - lib/karafka/web/ui/pro/views/dashboard/_ranges_selector.erb
302
+ - lib/karafka/web/ui/pro/views/dashboard/index.erb
260
303
  - lib/karafka/web/ui/pro/views/dlq/_breadcrumbs.erb
261
304
  - lib/karafka/web/ui/pro/views/dlq/_no_topics.erb
262
305
  - lib/karafka/web/ui/pro/views/dlq/_topic.erb
@@ -264,42 +307,69 @@ files:
264
307
  - lib/karafka/web/ui/pro/views/errors/_breadcrumbs.erb
265
308
  - lib/karafka/web/ui/pro/views/errors/_error.erb
266
309
  - lib/karafka/web/ui/pro/views/errors/_partition_option.erb
310
+ - lib/karafka/web/ui/pro/views/errors/_table.erb
311
+ - lib/karafka/web/ui/pro/views/errors/_title_with_select.erb
267
312
  - lib/karafka/web/ui/pro/views/errors/index.erb
313
+ - lib/karafka/web/ui/pro/views/errors/partition.erb
268
314
  - lib/karafka/web/ui/pro/views/errors/show.erb
269
315
  - lib/karafka/web/ui/pro/views/explorer/_breadcrumbs.erb
270
- - lib/karafka/web/ui/pro/views/explorer/_detail.erb
271
- - lib/karafka/web/ui/pro/views/explorer/_encryption_enabled.erb
272
316
  - lib/karafka/web/ui/pro/views/explorer/_failed_deserialization.erb
317
+ - lib/karafka/web/ui/pro/views/explorer/_filtered.erb
273
318
  - lib/karafka/web/ui/pro/views/explorer/_message.erb
319
+ - lib/karafka/web/ui/pro/views/explorer/_no_topics.erb
274
320
  - lib/karafka/web/ui/pro/views/explorer/_partition_option.erb
275
321
  - lib/karafka/web/ui/pro/views/explorer/_topic.erb
276
322
  - lib/karafka/web/ui/pro/views/explorer/index.erb
323
+ - lib/karafka/web/ui/pro/views/explorer/messages/_detail.erb
324
+ - lib/karafka/web/ui/pro/views/explorer/messages/_headers.erb
325
+ - lib/karafka/web/ui/pro/views/explorer/messages/_key.erb
277
326
  - lib/karafka/web/ui/pro/views/explorer/partition.erb
278
327
  - lib/karafka/web/ui/pro/views/explorer/partition/_cleaned.erb
328
+ - lib/karafka/web/ui/pro/views/explorer/partition/_details.erb
279
329
  - lib/karafka/web/ui/pro/views/explorer/partition/_empty.erb
280
330
  - lib/karafka/web/ui/pro/views/explorer/partition/_messages.erb
281
- - lib/karafka/web/ui/pro/views/explorer/partition/_watermark_offsets.erb
282
331
  - lib/karafka/web/ui/pro/views/explorer/show.erb
332
+ - lib/karafka/web/ui/pro/views/explorer/topic.erb
333
+ - lib/karafka/web/ui/pro/views/explorer/topic/_details.erb
334
+ - lib/karafka/web/ui/pro/views/explorer/topic/_empty.erb
335
+ - lib/karafka/web/ui/pro/views/explorer/topic/_limited.erb
283
336
  - lib/karafka/web/ui/pro/views/health/_breadcrumbs.erb
337
+ - lib/karafka/web/ui/pro/views/health/_no_data.erb
284
338
  - lib/karafka/web/ui/pro/views/health/_partition.erb
285
- - lib/karafka/web/ui/pro/views/health/index.erb
339
+ - lib/karafka/web/ui/pro/views/health/_partition_offset.erb
340
+ - lib/karafka/web/ui/pro/views/health/_tabs.erb
341
+ - lib/karafka/web/ui/pro/views/health/offsets.erb
342
+ - lib/karafka/web/ui/pro/views/health/overview.erb
286
343
  - lib/karafka/web/ui/pro/views/jobs/_job.erb
287
344
  - lib/karafka/web/ui/pro/views/jobs/_no_jobs.erb
288
345
  - lib/karafka/web/ui/pro/views/jobs/index.erb
346
+ - lib/karafka/web/ui/pro/views/routing/_consumer_group.erb
347
+ - lib/karafka/web/ui/pro/views/routing/_detail.erb
348
+ - lib/karafka/web/ui/pro/views/routing/_topic.erb
349
+ - lib/karafka/web/ui/pro/views/routing/index.erb
350
+ - lib/karafka/web/ui/pro/views/routing/show.erb
289
351
  - lib/karafka/web/ui/pro/views/shared/_navigation.erb
290
352
  - lib/karafka/web/ui/public/images/favicon.ico
353
+ - lib/karafka/web/ui/public/images/logo-gray.svg
291
354
  - lib/karafka/web/ui/public/images/logo.svg
292
355
  - lib/karafka/web/ui/public/javascripts/application.js
293
356
  - lib/karafka/web/ui/public/javascripts/bootstrap.min.js
357
+ - lib/karafka/web/ui/public/javascripts/chart.min.js
358
+ - lib/karafka/web/ui/public/javascripts/charts.js
359
+ - lib/karafka/web/ui/public/javascripts/datepicker.js
294
360
  - lib/karafka/web/ui/public/javascripts/highlight.min.js
295
361
  - lib/karafka/web/ui/public/javascripts/live_poll.js
362
+ - lib/karafka/web/ui/public/javascripts/offset_datetime.js
363
+ - lib/karafka/web/ui/public/javascripts/tabs.js
296
364
  - lib/karafka/web/ui/public/javascripts/timeago.min.js
297
365
  - lib/karafka/web/ui/public/stylesheets/application.css
298
366
  - lib/karafka/web/ui/public/stylesheets/bootstrap.min.css
299
367
  - lib/karafka/web/ui/public/stylesheets/bootstrap.min.css.map
368
+ - lib/karafka/web/ui/public/stylesheets/datepicker.min.css
300
369
  - lib/karafka/web/ui/public/stylesheets/highlight.min.css
301
370
  - lib/karafka/web/ui/views/cluster/_breadcrumbs.erb
302
371
  - lib/karafka/web/ui/views/cluster/_broker.erb
372
+ - lib/karafka/web/ui/views/cluster/_no_partitions.erb
303
373
  - lib/karafka/web/ui/views/cluster/_partition.erb
304
374
  - lib/karafka/web/ui/views/cluster/index.erb
305
375
  - lib/karafka/web/ui/views/consumers/_consumer.erb
@@ -307,6 +377,10 @@ files:
307
377
  - lib/karafka/web/ui/views/consumers/_no_consumers.erb
308
378
  - lib/karafka/web/ui/views/consumers/_summary.erb
309
379
  - lib/karafka/web/ui/views/consumers/index.erb
380
+ - lib/karafka/web/ui/views/dashboard/_feature_pro.erb
381
+ - lib/karafka/web/ui/views/dashboard/_not_enough_data.erb
382
+ - lib/karafka/web/ui/views/dashboard/_ranges_selector.erb
383
+ - lib/karafka/web/ui/views/dashboard/index.erb
310
384
  - lib/karafka/web/ui/views/errors/_breadcrumbs.erb
311
385
  - lib/karafka/web/ui/views/errors/_cleaned.erb
312
386
  - lib/karafka/web/ui/views/errors/_detail.erb
@@ -328,11 +402,17 @@ files:
328
402
  - lib/karafka/web/ui/views/routing/show.erb
329
403
  - lib/karafka/web/ui/views/shared/_become_pro.erb
330
404
  - lib/karafka/web/ui/views/shared/_brand.erb
405
+ - lib/karafka/web/ui/views/shared/_chart.erb
331
406
  - lib/karafka/web/ui/views/shared/_content.erb
332
407
  - lib/karafka/web/ui/views/shared/_feature_pro.erb
408
+ - lib/karafka/web/ui/views/shared/_flashes.erb
409
+ - lib/karafka/web/ui/views/shared/_footer.erb
333
410
  - lib/karafka/web/ui/views/shared/_header.erb
411
+ - lib/karafka/web/ui/views/shared/_live_poll.erb
334
412
  - lib/karafka/web/ui/views/shared/_navigation.erb
413
+ - lib/karafka/web/ui/views/shared/_no_paginated_data.erb
335
414
  - lib/karafka/web/ui/views/shared/_pagination.erb
415
+ - lib/karafka/web/ui/views/shared/_tab_nav.erb
336
416
  - lib/karafka/web/ui/views/shared/exceptions/not_found.erb
337
417
  - lib/karafka/web/ui/views/shared/exceptions/pro_only.erb
338
418
  - lib/karafka/web/ui/views/status/_breadcrumbs.erb
@@ -342,7 +422,10 @@ files:
342
422
  - lib/karafka/web/ui/views/status/_success.erb
343
423
  - lib/karafka/web/ui/views/status/_warning.erb
344
424
  - lib/karafka/web/ui/views/status/failures/_connection.erb
345
- - lib/karafka/web/ui/views/status/failures/_initial_state.erb
425
+ - lib/karafka/web/ui/views/status/failures/_consumers_reports_schema_state.erb
426
+ - lib/karafka/web/ui/views/status/failures/_enabled.erb
427
+ - lib/karafka/web/ui/views/status/failures/_initial_consumers_metrics.erb
428
+ - lib/karafka/web/ui/views/status/failures/_initial_consumers_state.erb
346
429
  - lib/karafka/web/ui/views/status/failures/_live_reporting.erb
347
430
  - lib/karafka/web/ui/views/status/failures/_partitions.erb
348
431
  - lib/karafka/web/ui/views/status/failures/_state_calculation.erb
@@ -350,8 +433,10 @@ files:
350
433
  - lib/karafka/web/ui/views/status/info/_components.erb
351
434
  - lib/karafka/web/ui/views/status/show.erb
352
435
  - lib/karafka/web/ui/views/status/successes/_connection.erb
436
+ - lib/karafka/web/ui/views/status/successes/_enabled.erb
353
437
  - lib/karafka/web/ui/views/status/warnings/_connection.erb
354
438
  - lib/karafka/web/ui/views/status/warnings/_pro_subscription.erb
439
+ - lib/karafka/web/ui/views/status/warnings/_replication.erb
355
440
  - lib/karafka/web/version.rb
356
441
  - renovate.json
357
442
  homepage: https://karafka.io
@@ -381,7 +466,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
381
466
  - !ruby/object:Gem::Version
382
467
  version: '0'
383
468
  requirements: []
384
- rubygems_version: 3.4.10
469
+ rubygems_version: 3.4.19
385
470
  signing_key:
386
471
  specification_version: 4
387
472
  summary: Karafka ecosystem Web UI interface
metadata.gz.sig CHANGED
Binary file
@@ -1,130 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Karafka
4
- module Web
5
- module Processing
6
- # Namespace for consumer sub-components
7
- module Consumers
8
- # Aggregator that tracks consumers processes states, aggregates the metrics and converts
9
- # data points into a materialized current state.
10
- class Aggregator
11
- include ::Karafka::Core::Helpers::Time
12
-
13
- def initialize
14
- # We keep whole reports for computation of active, current counters
15
- @active_reports = {}
16
- end
17
-
18
- # Uses provided process state report to update the current materialized state
19
- # @param report [Hash] consumer process state report
20
- # @param offset [Integer] offset of the message with the state report. This offset is
21
- # needed as we need to be able to get all the consumers reports from a given offset.
22
- def add(report, offset)
23
- memoize_process_report(report)
24
- increment_total_counters(report)
25
- update_process_state(report, offset)
26
- # We always evict after counters updates because we want to use expired (stopped)
27
- # data for counters as it was valid previously. This can happen only when web consumer
28
- # had a lag and is catching up.
29
- evict_expired_processes
30
- # We could calculate this on a per request basis but this would require fetching all
31
- # the active processes for each view and we do not want that for performance reasons
32
- refresh_current_stats
33
- end
34
-
35
- # @param _args [Object] extra parsing arguments (not used)
36
- # @return [String] json representation of the current processes state
37
- def to_json(*_args)
38
- state.to_json
39
- end
40
-
41
- private
42
-
43
- # @return [Hash] hash with current state from Kafka or an empty new initial state
44
- def state
45
- @state ||= State.current
46
- end
47
-
48
- # Updates the report for given process in memory
49
- # @param report [Hash]
50
- def memoize_process_report(report)
51
- @active_reports[report[:process][:name]] = report
52
- end
53
-
54
- # Increments the total counters based on the provided report
55
- # @param report [Hash]
56
- def increment_total_counters(report)
57
- report[:stats][:total].each do |key, value|
58
- state[:stats][key] ||= 0
59
- state[:stats][key] += value
60
- end
61
- end
62
-
63
- # Registers or updates the given process state based on the report
64
- #
65
- # @param report [Hash]
66
- # @param offset [Integer]
67
- def update_process_state(report, offset)
68
- process_name = report[:process][:name]
69
-
70
- state[:processes][process_name] = {
71
- dispatched_at: report[:dispatched_at],
72
- offset: offset
73
- }
74
- end
75
-
76
- # Evicts expired processes from the current state
77
- # We consider processes dead if they do not report often enough
78
- # @note We do not evict based on states (stopped), because we want to report the
79
- # stopped processes for extra time within the ttl limitations. This makes tracking of
80
- # things from UX perspective nicer.
81
- def evict_expired_processes
82
- max_ttl = float_now - ::Karafka::Web.config.ttl / 1_000
83
-
84
- state[:processes].delete_if do |_name, details|
85
- details[:dispatched_at] < max_ttl
86
- end
87
-
88
- @active_reports.delete_if do |_name, details|
89
- details[:dispatched_at] < max_ttl
90
- end
91
- end
92
-
93
- # Refreshes the counters that are computed based on incoming reports and not a total sum.
94
- # For this we use active reports we have in memory. It may not be accurate for the first
95
- # few seconds but it is much more optimal from performance perspective than computing
96
- # this fetching all data from Kafka for each view.
97
- def refresh_current_stats
98
- stats = state[:stats]
99
-
100
- stats[:busy] = 0
101
- stats[:enqueued] = 0
102
- stats[:threads_count] = 0
103
- stats[:processes] = 0
104
- stats[:rss] = 0
105
- stats[:listeners_count] = 0
106
- utilization = 0
107
-
108
- @active_reports
109
- .values
110
- .reject { |report| report[:process][:status] == 'stopped' }
111
- .each do |report|
112
- report_stats = report[:stats]
113
- report_process = report[:process]
114
-
115
- stats[:busy] += report_stats[:busy]
116
- stats[:enqueued] += report_stats[:enqueued]
117
- stats[:threads_count] += report_process[:concurrency]
118
- stats[:processes] += 1
119
- stats[:rss] += report_process[:memory_usage]
120
- stats[:listeners_count] += report_process[:listeners]
121
- utilization += report_stats[:utilization]
122
- end
123
-
124
- stats[:utilization] = utilization / (stats[:processes] + 0.0001)
125
- end
126
- end
127
- end
128
- end
129
- end
130
- end
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Karafka
4
- module Web
5
- module Tracking
6
- # Namespace for contracts used by consumers and producers tracking
7
- module Contracts
8
- # Base for all the metric related contracts
9
- class Base < ::Karafka::Core::Contractable::Contract
10
- class << self
11
- # This layer is not for users extensive feedback, thus we can easily use the minimum
12
- # error messaging there is.
13
- def configure
14
- super do |config|
15
- config.error_messages = YAML.safe_load(
16
- File.read(
17
- File.join(Karafka::Web.gem_root, 'config', 'locales', 'errors.yml')
18
- )
19
- ).fetch('en').fetch('validations').fetch('web')
20
- end
21
- end
22
- end
23
-
24
- # @param data [Hash] data for validation
25
- # @return [Boolean] true if all good
26
- # @raise [Errors::ContractError] invalid report
27
- def validate!(data)
28
- super(data, Errors::Tracking::ContractError)
29
- end
30
- end
31
- end
32
- end
33
- end
34
- end
@@ -1,38 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Karafka
4
- module Web
5
- module Ui
6
- module Lib
7
- # A simple wrapper for paginating array related data structures
8
- class PaginateArray
9
- # @param array [Array] array we want to paginate
10
- # @param current_page [Integer] page we want to be on
11
- # @return [Array<Array, <Integer, nil>>] Array with two elements: first is the array with
12
- # data of the given page and second is the next page number of nil in case there is
13
- # no next page (end of data)
14
- def call(array, current_page)
15
- slices = array.each_slice(per_page).to_a
16
-
17
- current_data = slices[current_page - 1] || []
18
-
19
- if slices.count >= current_page - 1 && current_data.size >= per_page
20
- next_page = current_page + 1
21
- else
22
- next_page = nil
23
- end
24
-
25
- [current_data, next_page]
26
- end
27
-
28
- private
29
-
30
- # @return [Integer] how many elements should we display in the UI
31
- def per_page
32
- ::Karafka::Web.config.ui.per_page
33
- end
34
- end
35
- end
36
- end
37
- end
38
- end
@@ -1,18 +0,0 @@
1
- <div class="row">
2
- <div class="col-sm-12">
3
- <div class="alert alert-warning" role="alert">
4
- <h4 class="alert-heading">
5
- The payload cannot be displayed.
6
- </h4>
7
- <p>
8
- Encryption is enabled.
9
- </p>
10
- <hr>
11
- <p class="mb-0">
12
- When encryption is enabled, the payload is not visible via the web UI.
13
-
14
- Please set the <code>ui.decrypt</code> config option to <code>true</code> if you want the payload to be visible here.
15
- </p>
16
- </div>
17
- </div>
18
- </div>
@@ -1,10 +0,0 @@
1
- <p class="text-end mb-4">
2
- Watermark offsets:
3
- <span class="badge bg-secondary mt-1 mb-1">
4
- high: <%= @watermark_offsets.high %>
5
- </span>
6
-
7
- <span class="badge bg-secondary mt-1 mb-1">
8
- low: <%= @watermark_offsets.low %>
9
- </span>
10
- </p>