karafka-web 0.7.9 → 0.8.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/.github/workflows/ci.yml +21 -6
  4. data/.ruby-version +1 -1
  5. data/CHANGELOG.md +66 -0
  6. data/Gemfile.lock +22 -22
  7. data/docker-compose.yml +3 -1
  8. data/karafka-web.gemspec +2 -2
  9. data/lib/karafka/web/config.rb +16 -3
  10. data/lib/karafka/web/contracts/config.rb +7 -2
  11. data/lib/karafka/web/errors.rb +12 -0
  12. data/lib/karafka/web/inflector.rb +33 -0
  13. data/lib/karafka/web/installer.rb +20 -11
  14. data/lib/karafka/web/management/actions/base.rb +36 -0
  15. data/lib/karafka/web/management/actions/clean_boot_file.rb +33 -0
  16. data/lib/karafka/web/management/actions/create_initial_states.rb +77 -0
  17. data/lib/karafka/web/management/actions/create_topics.rb +139 -0
  18. data/lib/karafka/web/management/actions/delete_topics.rb +30 -0
  19. data/lib/karafka/web/management/actions/enable.rb +117 -0
  20. data/lib/karafka/web/management/actions/extend_boot_file.rb +39 -0
  21. data/lib/karafka/web/management/actions/migrate_states_data.rb +18 -0
  22. data/lib/karafka/web/management/migrations/0_base.rb +58 -0
  23. data/lib/karafka/web/management/migrations/0_set_initial_consumers_metrics.rb +36 -0
  24. data/lib/karafka/web/management/migrations/0_set_initial_consumers_state.rb +43 -0
  25. data/lib/karafka/web/management/migrations/1699543515_fill_missing_received_and_sent_bytes_in_consumers_metrics.rb +26 -0
  26. data/lib/karafka/web/management/migrations/1699543515_fill_missing_received_and_sent_bytes_in_consumers_state.rb +23 -0
  27. data/lib/karafka/web/management/migrations/1700234522_introduce_waiting_in_consumers_metrics.rb +24 -0
  28. data/lib/karafka/web/management/migrations/1700234522_introduce_waiting_in_consumers_state.rb +20 -0
  29. data/lib/karafka/web/management/migrations/1700234522_remove_processing_from_consumers_metrics.rb +24 -0
  30. data/lib/karafka/web/management/migrations/1700234522_remove_processing_from_consumers_state.rb +20 -0
  31. data/lib/karafka/web/management/migrations/1704722380_split_listeners_into_active_and_paused_in_metrics.rb +36 -0
  32. data/lib/karafka/web/management/migrations/1704722380_split_listeners_into_active_and_paused_in_states.rb +32 -0
  33. data/lib/karafka/web/management/migrator.rb +117 -0
  34. data/lib/karafka/web/processing/consumer.rb +39 -38
  35. data/lib/karafka/web/processing/consumers/aggregators/metrics.rb +15 -7
  36. data/lib/karafka/web/processing/consumers/aggregators/state.rb +8 -3
  37. data/lib/karafka/web/processing/consumers/contracts/aggregated_stats.rb +5 -1
  38. data/lib/karafka/web/processing/publisher.rb +59 -0
  39. data/lib/karafka/web/tracking/consumers/contracts/job.rb +3 -2
  40. data/lib/karafka/web/tracking/consumers/contracts/partition.rb +1 -0
  41. data/lib/karafka/web/tracking/consumers/contracts/report.rb +6 -1
  42. data/lib/karafka/web/tracking/consumers/contracts/subscription_group.rb +10 -1
  43. data/lib/karafka/web/tracking/consumers/listeners/connections.rb +49 -0
  44. data/lib/karafka/web/tracking/consumers/listeners/pausing.rb +7 -4
  45. data/lib/karafka/web/tracking/consumers/listeners/processing.rb +78 -70
  46. data/lib/karafka/web/tracking/consumers/listeners/statistics.rb +40 -13
  47. data/lib/karafka/web/tracking/consumers/sampler.rb +82 -25
  48. data/lib/karafka/web/tracking/helpers/ttls/array.rb +72 -0
  49. data/lib/karafka/web/tracking/helpers/ttls/hash.rb +34 -0
  50. data/lib/karafka/web/tracking/helpers/ttls/stats.rb +49 -0
  51. data/lib/karafka/web/tracking/helpers/ttls/windows.rb +32 -0
  52. data/lib/karafka/web/tracking/reporter.rb +1 -0
  53. data/lib/karafka/web/ui/app.rb +22 -4
  54. data/lib/karafka/web/ui/base.rb +18 -2
  55. data/lib/karafka/web/ui/controllers/base.rb +34 -4
  56. data/lib/karafka/web/ui/controllers/become_pro.rb +1 -1
  57. data/lib/karafka/web/ui/controllers/cluster.rb +33 -9
  58. data/lib/karafka/web/ui/controllers/consumers.rb +8 -2
  59. data/lib/karafka/web/ui/controllers/dashboard.rb +2 -2
  60. data/lib/karafka/web/ui/controllers/errors.rb +2 -2
  61. data/lib/karafka/web/ui/controllers/jobs.rb +55 -5
  62. data/lib/karafka/web/ui/controllers/requests/params.rb +5 -0
  63. data/lib/karafka/web/ui/controllers/responses/deny.rb +15 -0
  64. data/lib/karafka/web/ui/controllers/responses/file.rb +23 -0
  65. data/lib/karafka/web/ui/controllers/responses/{data.rb → render.rb} +3 -3
  66. data/lib/karafka/web/ui/controllers/routing.rb +11 -2
  67. data/lib/karafka/web/ui/controllers/status.rb +1 -1
  68. data/lib/karafka/web/ui/helpers/application_helper.rb +70 -0
  69. data/lib/karafka/web/ui/lib/hash_proxy.rb +29 -14
  70. data/lib/karafka/web/ui/lib/sorter.rb +170 -0
  71. data/lib/karafka/web/ui/models/counters.rb +6 -0
  72. data/lib/karafka/web/ui/models/health.rb +23 -2
  73. data/lib/karafka/web/ui/models/jobs.rb +48 -0
  74. data/lib/karafka/web/ui/models/metrics/charts/aggregated.rb +33 -0
  75. data/lib/karafka/web/ui/models/metrics/charts/topics.rb +1 -10
  76. data/lib/karafka/web/ui/models/process.rb +2 -1
  77. data/lib/karafka/web/ui/models/status.rb +23 -7
  78. data/lib/karafka/web/ui/models/topic.rb +3 -1
  79. data/lib/karafka/web/ui/models/visibility_filter.rb +16 -0
  80. data/lib/karafka/web/ui/pro/app.rb +44 -6
  81. data/lib/karafka/web/ui/pro/controllers/cluster.rb +1 -0
  82. data/lib/karafka/web/ui/pro/controllers/consumers.rb +52 -6
  83. data/lib/karafka/web/ui/pro/controllers/dashboard.rb +1 -1
  84. data/lib/karafka/web/ui/pro/controllers/dlq.rb +1 -1
  85. data/lib/karafka/web/ui/pro/controllers/errors.rb +3 -3
  86. data/lib/karafka/web/ui/pro/controllers/explorer.rb +8 -8
  87. data/lib/karafka/web/ui/pro/controllers/health.rb +34 -2
  88. data/lib/karafka/web/ui/pro/controllers/jobs.rb +11 -0
  89. data/lib/karafka/web/ui/pro/controllers/messages.rb +42 -0
  90. data/lib/karafka/web/ui/pro/controllers/routing.rb +11 -2
  91. data/lib/karafka/web/ui/pro/views/consumers/_breadcrumbs.erb +8 -2
  92. data/lib/karafka/web/ui/pro/views/consumers/_consumer.erb +14 -8
  93. data/lib/karafka/web/ui/pro/views/consumers/_counters.erb +8 -6
  94. data/lib/karafka/web/ui/pro/views/consumers/consumer/_job.erb +4 -1
  95. data/lib/karafka/web/ui/pro/views/consumers/consumer/_no_jobs.erb +1 -1
  96. data/lib/karafka/web/ui/pro/views/consumers/consumer/_partition.erb +1 -3
  97. data/lib/karafka/web/ui/pro/views/consumers/consumer/_subscription_group.erb +28 -11
  98. data/lib/karafka/web/ui/pro/views/consumers/consumer/_tabs.erb +10 -3
  99. data/lib/karafka/web/ui/pro/views/consumers/index.erb +3 -3
  100. data/lib/karafka/web/ui/pro/views/consumers/pending_jobs.erb +43 -0
  101. data/lib/karafka/web/ui/pro/views/consumers/{jobs.erb → running_jobs.erb} +11 -10
  102. data/lib/karafka/web/ui/pro/views/dashboard/index.erb +7 -1
  103. data/lib/karafka/web/ui/pro/views/explorer/message/_message_actions.erb +18 -0
  104. data/lib/karafka/web/ui/pro/views/explorer/message/_metadata.erb +43 -0
  105. data/lib/karafka/web/ui/pro/views/explorer/message/_payload.erb +21 -0
  106. data/lib/karafka/web/ui/pro/views/explorer/message/_payload_actions.erb +19 -0
  107. data/lib/karafka/web/ui/pro/views/explorer/show.erb +9 -84
  108. data/lib/karafka/web/ui/pro/views/health/_breadcrumbs.erb +8 -0
  109. data/lib/karafka/web/ui/pro/views/health/_partition.erb +1 -3
  110. data/lib/karafka/web/ui/pro/views/health/_partition_offset.erb +4 -4
  111. data/lib/karafka/web/ui/pro/views/health/_partition_times.erb +32 -0
  112. data/lib/karafka/web/ui/pro/views/health/_tabs.erb +9 -0
  113. data/lib/karafka/web/ui/pro/views/health/changes.erb +66 -0
  114. data/lib/karafka/web/ui/pro/views/health/offsets.erb +14 -14
  115. data/lib/karafka/web/ui/pro/views/health/overview.erb +11 -11
  116. data/lib/karafka/web/ui/pro/views/jobs/_job.erb +1 -1
  117. data/lib/karafka/web/ui/pro/views/jobs/_no_jobs.erb +1 -1
  118. data/lib/karafka/web/ui/pro/views/jobs/pending.erb +39 -0
  119. data/lib/karafka/web/ui/pro/views/jobs/running.erb +39 -0
  120. data/lib/karafka/web/ui/pro/views/routing/_consumer_group.erb +2 -2
  121. data/lib/karafka/web/ui/pro/views/routing/_topic.erb +9 -0
  122. data/lib/karafka/web/ui/pro/views/routing/show.erb +12 -0
  123. data/lib/karafka/web/ui/pro/views/shared/_navigation.erb +1 -1
  124. data/lib/karafka/web/ui/public/javascripts/application.js +10 -0
  125. data/lib/karafka/web/ui/public/stylesheets/application.css +4 -0
  126. data/lib/karafka/web/ui/views/cluster/_breadcrumbs.erb +16 -0
  127. data/lib/karafka/web/ui/views/cluster/_tabs.erb +27 -0
  128. data/lib/karafka/web/ui/views/cluster/brokers.erb +27 -0
  129. data/lib/karafka/web/ui/views/cluster/topics.erb +35 -0
  130. data/lib/karafka/web/ui/views/consumers/_counters.erb +8 -6
  131. data/lib/karafka/web/ui/views/consumers/_summary.erb +2 -2
  132. data/lib/karafka/web/ui/views/consumers/index.erb +3 -3
  133. data/lib/karafka/web/ui/views/dashboard/_ranges_selector.erb +23 -7
  134. data/lib/karafka/web/ui/views/dashboard/index.erb +19 -8
  135. data/lib/karafka/web/ui/views/errors/show.erb +2 -23
  136. data/lib/karafka/web/ui/views/jobs/_breadcrumbs.erb +17 -1
  137. data/lib/karafka/web/ui/views/jobs/_job.erb +1 -1
  138. data/lib/karafka/web/ui/views/jobs/_no_jobs.erb +1 -1
  139. data/lib/karafka/web/ui/views/jobs/_tabs.erb +27 -0
  140. data/lib/karafka/web/ui/views/jobs/{index.erb → pending.erb} +9 -7
  141. data/lib/karafka/web/ui/{pro/views/jobs/index.erb → views/jobs/running.erb} +9 -11
  142. data/lib/karafka/web/ui/views/routing/_consumer_group.erb +14 -12
  143. data/lib/karafka/web/ui/views/shared/_navigation.erb +1 -1
  144. data/lib/karafka/web/ui/views/shared/_pagination.erb +1 -1
  145. data/lib/karafka/web/ui/views/shared/exceptions/not_allowed.erb +37 -0
  146. data/lib/karafka/web/ui/views/status/show.erb +17 -2
  147. data/lib/karafka/web/ui/views/status/warnings/_routing_topics_presence.erb +15 -0
  148. data/lib/karafka/web/version.rb +1 -1
  149. data/lib/karafka/web.rb +6 -2
  150. data.tar.gz.sig +0 -0
  151. metadata +61 -26
  152. metadata.gz.sig +0 -0
  153. data/lib/karafka/web/management/base.rb +0 -34
  154. data/lib/karafka/web/management/clean_boot_file.rb +0 -31
  155. data/lib/karafka/web/management/create_initial_states.rb +0 -101
  156. data/lib/karafka/web/management/create_topics.rb +0 -133
  157. data/lib/karafka/web/management/delete_topics.rb +0 -28
  158. data/lib/karafka/web/management/enable.rb +0 -102
  159. data/lib/karafka/web/management/extend_boot_file.rb +0 -37
  160. data/lib/karafka/web/tracking/ttl_array.rb +0 -59
  161. data/lib/karafka/web/tracking/ttl_hash.rb +0 -16
  162. data/lib/karafka/web/ui/pro/views/dashboard/_ranges_selector.erb +0 -39
  163. data/lib/karafka/web/ui/views/cluster/index.erb +0 -74
@@ -0,0 +1,21 @@
1
+ <% if @visibility_filter.payload?(@message) %>
2
+ <div class="row">
3
+ <div class="col-sm-12 mb-4">
4
+ <% if @payload_error %>
5
+ <%== partial 'explorer/failed_deserialization' %>
6
+ <% end %>
7
+
8
+ <div class="card">
9
+ <div class="card-body">
10
+ <% if @payload_error %>
11
+ <pre class="m-0 p-0"><code class="wrapped json p-0 m-0"><%= @message.raw_payload %></code></pre>
12
+ <% else %>
13
+ <pre class="m-0 p-0"><code class="wrapped json p-0 m-0"><%= @pretty_payload %></code></pre>
14
+ <% end %>
15
+ </div>
16
+ </div>
17
+ </div>
18
+ </div>
19
+ <% else %>
20
+ <%== partial 'explorer/filtered' %>
21
+ <% end %>
@@ -0,0 +1,19 @@
1
+ <div class="float-end text-end">
2
+ <% if @visibility_filter.download?(@message) %>
3
+ <a
4
+ href="<%= root_path('messages', @message.topic, @message.partition, @message.offset, 'download') %>"
5
+ class="btn btn-secondary btn-sm"
6
+ >
7
+ &#8659; Download raw
8
+ </a>
9
+ <% end %>
10
+
11
+ <% if @visibility_filter.export?(@message) && !@payload_error %>
12
+ <a
13
+ href="<%= root_path('messages', @message.topic, @message.partition, @message.offset, 'export') %>"
14
+ class="btn btn-secondary btn-sm"
15
+ >
16
+ &#8659; Export as JSON
17
+ </a>
18
+ <% end %>
19
+ </div>
@@ -1,22 +1,5 @@
1
- <%
2
- republish_path = root_path('messages', @message.topic, @message.partition, @message.offset, 'republish')
3
- surrounding_path = explorer_path(@message.topic, @message.partition, @message.offset, 'surrounding')
4
- %>
5
-
6
1
  <div class="container">
7
- <div class="row mb-0">
8
- <div class="col-sm-12 text-end">
9
- <a href="<%= surrounding_path %>" class="btn btn-secondary btn-sm float-end ms-1">
10
- &#8651;
11
- Surrounding
12
- </a>
13
-
14
- <form action="<%= republish_path %>" method="post" class="confirm-action float-end">
15
- <%== csrf_tag(republish_path) %>
16
- <input type="submit" value="&#10227; Republish" class="btn btn-primary btn-sm"/>
17
- </form>
18
- </div>
19
- </div>
2
+ <%== partial 'explorer/message/message_actions' %>
20
3
 
21
4
  <div class="row mb-4">
22
5
  <div class="col-sm-12">
@@ -28,81 +11,23 @@
28
11
  </div>
29
12
  </div>
30
13
 
31
- <div class="row mb-5">
32
- <div class="col-sm-12">
33
- <table class="processes bg-white table table-hover table-bordered table-striped mb-0 align-middle">
34
- <tbody>
35
- <% @message.metadata.to_h.except(:received_at, :key, :headers).each do |k, v| %>
36
- <%==
37
- partial(
38
- 'explorer/messages/detail',
39
- locals: {
40
- k: k,
41
- v: v
42
- }
43
- )
44
- %>
45
- <% end %>
46
-
47
- <%==
48
- partial(
49
- 'explorer/messages/detail',
50
- locals: {
51
- k: 'bytesize',
52
- v: format_memory(((@message.raw_payload&.bytesize || 0) / 1024.to_f).round(4))
53
- }
54
- )
55
- %>
56
-
57
- <%==
58
- partial(
59
- 'explorer/messages/key',
60
- locals: { message: @message }
61
- )
62
- %>
63
-
64
- <%==
65
- partial(
66
- 'explorer/messages/headers',
67
- locals: { message: @message }
68
- )
69
- %>
70
- </tbody>
71
- </table>
72
- </div>
73
- </div>
14
+ <%== partial 'explorer/message/metadata' %>
74
15
  </div>
75
16
 
76
17
  <div class="container">
77
18
  <div class="row mb-4">
78
19
  <div class="col-sm-12">
79
- <h5 class="mb-2">
20
+ <h5 class="mb-2 float-start">
80
21
  Payload
81
22
  </h5>
82
- <hr/>
83
23
 
84
- </div>
85
- </div>
24
+ <%== partial 'explorer/message/payload_actions' %>
86
25
 
87
- <% if @visibility_filter.payload?(@message) %>
88
- <div class="row">
89
- <div class="col-sm-12 mb-4">
90
- <% if @payload_error %>
91
- <%== partial 'explorer/failed_deserialization' %>
92
- <% end %>
26
+ <div class="clearfix"></div>
93
27
 
94
- <div class="card">
95
- <div class="card-body">
96
- <% if @payload_error %>
97
- <pre class="m-0 p-0"><code class="wrapped json p-0 m-0"><%= @message.raw_payload %></code></pre>
98
- <% else %>
99
- <pre class="m-0 p-0"><code class="wrapped json p-0 m-0"><%= @pretty_payload %></code></pre>
100
- <% end %>
101
- </div>
102
- </div>
103
- </div>
28
+ <hr/>
104
29
  </div>
105
- <% else %>
106
- <%== partial 'explorer/filtered' %>
107
- <% end %>
30
+ </div>
31
+
32
+ <%== partial 'explorer/message/payload' %>
108
33
  </div>
@@ -19,3 +19,11 @@
19
19
  </a>
20
20
  </li>
21
21
  <% end %>
22
+
23
+ <% if current_path.include?('/changes') %>
24
+ <li class="breadcrumb-item">
25
+ <a href="<%= root_path('health', 'changes') %>">
26
+ Changes
27
+ </a>
28
+ </li>
29
+ <% end %>
@@ -22,9 +22,7 @@
22
22
  </span>
23
23
  </td>
24
24
  <td>
25
- <span class="badge <%= kafka_state_bg(details.poll_state) %> mt-1 mb-1">
26
- <%= details.poll_state %>
27
- </span>
25
+ <%== poll_state_with_change_time_label(details.poll_state, details.poll_state_ch) %>
28
26
  </td>
29
27
  <td>
30
28
  <span class="badge bg-success <%= lso_risk_state_bg(details) %> bg-opacity-100">
@@ -9,13 +9,13 @@
9
9
  <%== offset_with_label topic_name, partition_id, details.committed_offset %>
10
10
  </td>
11
11
  <td>
12
- <%== relative_time(Time.now - details.committed_offset_fd / 1_000) %>
12
+ <%== relative_time(Time.now - details.committed_offset_fd / 1_000.0) %>
13
13
  </td>
14
14
  <td>
15
15
  <%== offset_with_label topic_name, partition_id, details.stored_offset %>
16
16
  </td>
17
17
  <td>
18
- <%== relative_time(Time.now - details.stored_offset_fd / 1_000) %>
18
+ <%== relative_time(Time.now - details.stored_offset_fd / 1_000.0) %>
19
19
  </td>
20
20
  <td>
21
21
  <%== offset_with_label topic_name, partition_id, details.lo_offset %>
@@ -24,13 +24,13 @@
24
24
  <%== offset_with_label topic_name, partition_id, details.hi_offset %>
25
25
  </td>
26
26
  <td>
27
- <%== relative_time(Time.now - details.hi_offset_fd / 1_000) %>
27
+ <%== relative_time(Time.now - details.hi_offset_fd / 1_000.0) %>
28
28
  </td>
29
29
  <td>
30
30
  <%== offset_with_label topic_name, partition_id, details.ls_offset %>
31
31
  </td>
32
32
  <td>
33
- <%== relative_time(Time.now - details.ls_offset_fd / 1_000) %>
33
+ <%== relative_time(Time.now - details.ls_offset_fd / 1_000.0) %>
34
34
  </td>
35
35
  <td>
36
36
  <span class="badge bg-success <%= lso_risk_state_bg(details) %> bg-opacity-100">
@@ -0,0 +1,32 @@
1
+ <tr class="align-middle <%= lso_risk_state_bg(details) %> status-row-<%= details.process.status %>">
2
+ <td>
3
+ <%= partition_id %>
4
+ </td>
5
+ <td>
6
+ <%== relative_time(Time.now - details.committed_offset_fd / 1_000.0) %>
7
+ </td>
8
+ <td>
9
+ <%== relative_time(Time.now - details.stored_offset_fd / 1_000.0) %>
10
+ </td>
11
+ <td>
12
+ <%== relative_time(Time.now - details.hi_offset_fd / 1_000.0) %>
13
+ </td>
14
+ <td>
15
+ <%== relative_time(Time.now - details.ls_offset_fd / 1_000.0) %>
16
+ </td>
17
+ <td>
18
+ <% change_in_seconds = details.poll_state_ch / 1_000.0 %>
19
+
20
+ <% if details.poll_state == 'active' %>
21
+ <span class="badge bg-secondary">
22
+ N/A
23
+ </span>
24
+ <% elsif change_in_seconds >= 60 * 60 * 31 * 12 %>
25
+ <span class="badge bg-secondary">
26
+ Until manual resume
27
+ </span>
28
+ <% else %>
29
+ <%== relative_time(Time.now + change_in_seconds) %>
30
+ <% end %>
31
+ </td>
32
+ </tr>
@@ -20,6 +20,15 @@
20
20
  Offsets
21
21
  </a>
22
22
  </li>
23
+
24
+ <li class="nav-item">
25
+ <a
26
+ class="nav-link <%= nav_class(include: 'changes') %>"
27
+ href="<%= root_path('health', 'changes') %>"
28
+ >
29
+ Changes
30
+ </a>
31
+ </li>
23
32
  </ul>
24
33
 
25
34
  </div>
@@ -0,0 +1,66 @@
1
+ <%== view_title('Consumers groups changes details') %>
2
+
3
+ <% if @stats.empty? %>
4
+ <%== partial 'health/no_data' %>
5
+ <% else %>
6
+ <%== partial 'health/tabs' %>
7
+ <% end %>
8
+
9
+
10
+ <% @stats.each_with_index do |(cg_name, details), index| %>
11
+ <div class="container mb-5">
12
+ <div class="row mb-4">
13
+ <div class="col-sm-8">
14
+ <h4 class="mb-4"><%= cg_name %></h4>
15
+ </div>
16
+
17
+ <div class="col-sm-4">
18
+ <span class="float-end">
19
+ Last rebalance:
20
+ <span class="badge bg-secondary">
21
+ <%== relative_time(details[:rebalanced_at]) %>
22
+ </span>
23
+ </span>
24
+ </div>
25
+ </div>
26
+
27
+ <div class="row mb-3">
28
+ <div class="col-sm-12">
29
+ <% topics = details[:topics] %>
30
+ <% topics.each_with_index do |(topic_name, partitions), index| %>
31
+ <table class="processes bg-white table table-hover table-bordered table-striped align-middle <%= (index+1 < topics.size) ? 'mb-5' : 'mb-3' %>">
32
+ <thead>
33
+ <tr class="align-middle">
34
+ <th colspan="12">
35
+ <h5 class="mb-0"><%= topic_name %></h4>
36
+ </th>
37
+ </tr>
38
+ <tr class="align-middle">
39
+ <th><%== sort_link('Partition', :id) %></th>
40
+ <th><%== sort_link('Committed offset change', :committed_offset_fd) %></th>
41
+ <th><%== sort_link('Stored offset change', :stored_offset_fd) %></th>
42
+ <th><%== sort_link('High offset change', :hi_offset_fd) %></th>
43
+ <th><%== sort_link('Last stable offset state', :lso_risk_state) %></th>
44
+ <th><%== sort_link('Pause state change', :poll_state_ch) %></th>
45
+ </tr>
46
+ </thead>
47
+ <tbody>
48
+ <% partitions.each do |partition_id, details| %>
49
+ <%==
50
+ partial(
51
+ 'health/partition_times',
52
+ locals: {
53
+ topic_name: topic_name,
54
+ partition_id: partition_id,
55
+ details: details
56
+ }
57
+ )
58
+ %>
59
+ <% end %>
60
+ </tbody>
61
+ </table>
62
+ <% end %>
63
+ </div>
64
+ </div>
65
+ </div>
66
+ <% end %>
@@ -25,7 +25,7 @@
25
25
 
26
26
  <div class="row mb-3">
27
27
  <div class="col-sm-12">
28
- <% topics = details[:topics].sort_by(&:first) %>
28
+ <% topics = details[:topics] %>
29
29
  <% topics.each_with_index do |(topic_name, partitions), index| %>
30
30
  <table class="processes bg-white table table-hover table-bordered table-striped align-middle <%= (index+1 < topics.size) ? 'mb-5' : 'mb-3' %>">
31
31
  <thead>
@@ -35,22 +35,22 @@
35
35
  </th>
36
36
  </tr>
37
37
  <tr class="align-middle">
38
- <th>Partition</th>
39
- <th>Lag stored</th>
40
- <th>Committed offset</th>
41
- <th>Committed offset change</th>
42
- <th>Stored offset</th>
43
- <th>Stored offset change</th>
44
- <th>Low offset</th>
45
- <th>High offset</th>
46
- <th>High offset change</th>
47
- <th>Last stable offset</th>
48
- <th>Last stable offset change</th>
49
- <th>Last stable offset state</th>
38
+ <th><%== sort_link('Partition', :id) %></th>
39
+ <th><%== sort_link(:lag_stored) %></th>
40
+ <th><%== sort_link(:committed_offset) %></th>
41
+ <th><%== sort_link('Committed offset change', :committed_offset_fd) %></th>
42
+ <th><%== sort_link(:stored_offset) %></th>
43
+ <th><%== sort_link('Stored offset change', :stored_offset_fd) %></th>
44
+ <th><%== sort_link('Low offset', :lo_offset) %></th>
45
+ <th><%== sort_link('High offset', :hi_offset) %></th>
46
+ <th><%== sort_link('High offset change', :hi_offset_fd) %></th>
47
+ <th><%== sort_link('Last stable offset', :ls_offset) %></th>
48
+ <th><%== sort_link('Last stable offset change', :ls_offset_fd) %></th>
49
+ <th><%== sort_link('Last stable offset state', :lso_risk_state) %></th>
50
50
  </tr>
51
51
  </thead>
52
52
  <tbody>
53
- <% partitions.sort_by(&:first).each do |partition_id, details| %>
53
+ <% partitions.each do |partition_id, details| %>
54
54
  <%==
55
55
  partial(
56
56
  'health/partition_offset',
@@ -25,7 +25,7 @@
25
25
 
26
26
  <div class="row mb-3">
27
27
  <div class="col-sm-12">
28
- <% topics = details[:topics].sort_by(&:first) %>
28
+ <% topics = details[:topics] %>
29
29
  <% topics.each_with_index do |(topic_name, partitions), index| %>
30
30
  <table class="processes bg-white table table-hover table-bordered table-striped align-middle <%= (index+1 < topics.size) ? 'mb-5' : 'mb-3' %>">
31
31
  <thead>
@@ -35,19 +35,19 @@
35
35
  </th>
36
36
  </tr>
37
37
  <tr class="align-middle">
38
- <th>Partition</th>
39
- <th>Lag stored</th>
40
- <th>Lag stored trend</th>
41
- <th>Committed offset</th>
42
- <th>Stored offset</th>
43
- <th>Fetch state</th>
44
- <th>Poll state</th>
45
- <th>LSO state</th>
46
- <th>Process name</th>
38
+ <th><%== sort_link('Partition', :id) %></th>
39
+ <th><%== sort_link(:lag_stored) %></th>
40
+ <th><%== sort_link('Lag stored trend', :lag_stored_d) %></th>
41
+ <th><%== sort_link(:committed_offset) %></th>
42
+ <th><%== sort_link(:stored_offset) %></th>
43
+ <th><%== sort_link(:fetch_state) %></th>
44
+ <th><%== sort_link(:poll_state) %></th>
45
+ <th><%== sort_link('LSO state', :lso_risk_state) %></th>
46
+ <th><%== sort_link('Process name', :name) %></th>
47
47
  </tr>
48
48
  </thead>
49
49
  <tbody>
50
- <% partitions.sort_by(&:first).each do |partition_id, details| %>
50
+ <% partitions.each do |partition_id, details| %>
51
51
  <%==
52
52
  partial(
53
53
  'health/partition',
@@ -34,6 +34,6 @@
34
34
  <%== offset_with_label job.topic, job.partition, job.committed_offset %>
35
35
  </td>
36
36
  <td>
37
- <%== relative_time job.started_at %>
37
+ <%== relative_time job.updated_at %>
38
38
  </td>
39
39
  </tr>
@@ -2,7 +2,7 @@
2
2
  <div class="row">
3
3
  <div class="col-lg-12">
4
4
  <div class="alert alert-info" role="alert">
5
- There are no running jobs at the moment.
5
+ There are no <%= type %> jobs at the moment.
6
6
  </div>
7
7
  </div>
8
8
  </div>
@@ -0,0 +1,39 @@
1
+ <%== view_title('Pending jobs overview', hr: false) %>
2
+
3
+ <%== partial 'jobs/tabs' %>
4
+
5
+ <% if @jobs.empty? && params.current_page <= 1 %>
6
+ <%== partial 'jobs/no_jobs', locals: { type: 'pending' } %>
7
+ <% elsif @jobs.empty? %>
8
+ <%== partial 'shared/no_paginated_data' %>
9
+ <% else %>
10
+ <div class="container">
11
+ <div class="row mb-5">
12
+ <div class="col-sm-12">
13
+ <table class="processes bg-white table table-hover table-bordered table-striped mb-0 align-middle">
14
+ <thead>
15
+ <tr class="align-middle">
16
+ <th><%== sort_link('Process', :name) %></th>
17
+ <th><%== sort_link(:topic) %></th>
18
+ <th><%== sort_link(:consumer) %></th>
19
+ <th><%== sort_link(:type) %></th>
20
+ <th><%== sort_link(:messages) %></th>
21
+ <th><%== sort_link(:first_offset) %></th>
22
+ <th><%== sort_link(:last_offset) %></th>
23
+ <th><%== sort_link(:committed_offset) %></th>
24
+ <th><%== sort_link('Created at', :updated_at, rev: true) %></th>
25
+ </tr>
26
+ </thead>
27
+ <tbody>
28
+ <%==
29
+ each_partial(
30
+ @jobs,
31
+ 'jobs/job'
32
+ )
33
+ %>
34
+ </tbody>
35
+ </table>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ <% end %>
@@ -0,0 +1,39 @@
1
+ <%== view_title('Running jobs overview', hr: false) %>
2
+
3
+ <%== partial 'jobs/tabs' %>
4
+
5
+ <% if @jobs.empty? && params.current_page <= 1 %>
6
+ <%== partial 'jobs/no_jobs', locals: { type: 'running' } %>
7
+ <% elsif @jobs.empty? %>
8
+ <%== partial 'shared/no_paginated_data' %>
9
+ <% else %>
10
+ <div class="container">
11
+ <div class="row mb-5">
12
+ <div class="col-sm-12">
13
+ <table class="processes bg-white table table-hover table-bordered table-striped mb-0 align-middle">
14
+ <thead>
15
+ <tr class="align-middle">
16
+ <th><%== sort_link('Process', :name) %></th>
17
+ <th><%== sort_link(:topic) %></th>
18
+ <th><%== sort_link(:consumer) %></th>
19
+ <th><%== sort_link(:type) %></th>
20
+ <th><%== sort_link(:messages) %></th>
21
+ <th><%== sort_link(:first_offset) %></th>
22
+ <th><%== sort_link(:last_offset) %></th>
23
+ <th><%== sort_link(:committed_offset) %></th>
24
+ <th><%== sort_link('Started at', :updated_at, rev: true) %></th>
25
+ </tr>
26
+ </thead>
27
+ <tbody>
28
+ <%==
29
+ each_partial(
30
+ @jobs,
31
+ 'jobs/job'
32
+ )
33
+ %>
34
+ </tbody>
35
+ </table>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ <% end %>
@@ -13,9 +13,9 @@
13
13
  <thead>
14
14
  <tr class="align-middle">
15
15
  <th>Subscription group</th>
16
- <th>Topic</th>
16
+ <th><%== sort_link('Topic', :name) %></th>
17
17
  <th>Type</th>
18
- <th>Active</th>
18
+ <th><%== sort_link('Active', :active?) %></th>
19
19
  <th></th>
20
20
  </tr>
21
21
  </thead>
@@ -9,6 +9,15 @@
9
9
  <span class="badge bg-secondary">
10
10
  <%= topic.patterns.type %>
11
11
  </span>
12
+
13
+ <% if subscription_group.multiplexing? %>
14
+ <span class="badge bg-secondary">
15
+ multiplexing
16
+ <%= subscription_group.multiplexing.min %>
17
+ -
18
+ <%= subscription_group.multiplexing.max %>
19
+ </span>
20
+ <% end %>
12
21
  </td>
13
22
  <td>
14
23
  <span class="badge bg-<%= topic.active? ? 'success' : 'warning text-dark' %>">
@@ -19,6 +19,18 @@
19
19
  )
20
20
  %>
21
21
  <% end %>
22
+
23
+ <% flat_hash(@topic.subscription_group.multiplexing.to_h).each do |k, v| %>
24
+ <%==
25
+ partial(
26
+ 'routing/detail',
27
+ locals: {
28
+ k: "multiplexing.#{k}",
29
+ v: v
30
+ }
31
+ )
32
+ %>
33
+ <% end %>
22
34
  </tbody>
23
35
  </table>
24
36
  </div>
@@ -15,7 +15,7 @@
15
15
  </a>
16
16
  </li>
17
17
  <li class="nav-item ms-3">
18
- <a class="nav-link <%= nav_class(start_with: '/jobs') %>" href="<%= root_path('jobs') %>">
18
+ <a class="nav-link <%= nav_class(start_with: '/jobs') %>" href="<%= root_path('jobs/running') %>">
19
19
  Jobs
20
20
  </a>
21
21
  </li>
@@ -6,6 +6,16 @@ function updateTimeAgo() {
6
6
  timeago.render(selection);
7
7
  timeago.cancel()
8
8
  }
9
+
10
+ var selection = document.getElementsByClassName('time-title')
11
+ var title = null
12
+
13
+ for (var i = 0; i < selection.length; i++) {
14
+ let element = selection[i]
15
+
16
+ title = element.getAttribute('title')
17
+ element.setAttribute('title', timeago.format(title))
18
+ }
9
19
  }
10
20
 
11
21
  // To prevent from flickering, the UI is initially hidden and visible when all the JS components
@@ -123,3 +123,7 @@ main {
123
123
  .chartjs-wrapper {
124
124
  height: 250px;
125
125
  }
126
+
127
+ a.sort {
128
+ color: inherit;
129
+ }
@@ -3,3 +3,19 @@
3
3
  Cluster informations
4
4
  </a>
5
5
  </li>
6
+
7
+ <% if current_path.include?('/brokers') %>
8
+ <li class="breadcrumb-item">
9
+ <a href="<%= root_path('cluster', 'brokers') %>">
10
+ Brokers
11
+ </a>
12
+ </li>
13
+ <% end %>
14
+
15
+ <% if current_path.include?('/topics') %>
16
+ <li class="breadcrumb-item">
17
+ <a href="<%= root_path('cluster', 'topics') %>">
18
+ Topics
19
+ </a>
20
+ </li>
21
+ <% end %>
@@ -0,0 +1,27 @@
1
+ <div class="container">
2
+ <div class="row mb-4">
3
+ <div class="col-sm-12">
4
+
5
+ <ul class="nav nav-tabs">
6
+ <li class="nav-item">
7
+ <a
8
+ class="nav-link <%= nav_class(include: 'brokers') %>"
9
+ href="<%= root_path('cluster', 'brokers') %>"
10
+ >
11
+ Brokers
12
+ </a>
13
+ </li>
14
+
15
+ <li class="nav-item">
16
+ <a
17
+ class="nav-link <%= nav_class(include: 'topics') %>"
18
+ href="<%= root_path('cluster', 'topics') %>"
19
+ >
20
+ Topics
21
+ </a>
22
+ </li>
23
+ </ul>
24
+
25
+ </div>
26
+ </div>
27
+ </div>