sidekiq 3.4.1 → 7.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (235) hide show
  1. checksums.yaml +5 -5
  2. data/Changes.md +1118 -4
  3. data/LICENSE.txt +9 -0
  4. data/README.md +55 -47
  5. data/bin/multi_queue_bench +271 -0
  6. data/bin/sidekiq +26 -3
  7. data/bin/sidekiqload +247 -0
  8. data/bin/sidekiqmon +11 -0
  9. data/lib/generators/sidekiq/job_generator.rb +57 -0
  10. data/lib/generators/sidekiq/templates/{worker.rb.erb → job.rb.erb} +2 -2
  11. data/lib/generators/sidekiq/templates/job_spec.rb.erb +6 -0
  12. data/lib/generators/sidekiq/templates/job_test.rb.erb +8 -0
  13. data/lib/sidekiq/api.rb +714 -312
  14. data/lib/sidekiq/capsule.rb +130 -0
  15. data/lib/sidekiq/cli.rb +275 -241
  16. data/lib/sidekiq/client.rb +141 -110
  17. data/lib/sidekiq/component.rb +68 -0
  18. data/lib/sidekiq/config.rb +291 -0
  19. data/lib/sidekiq/deploy.rb +62 -0
  20. data/lib/sidekiq/embedded.rb +61 -0
  21. data/lib/sidekiq/fetch.rb +53 -121
  22. data/lib/sidekiq/iterable_job.rb +53 -0
  23. data/lib/sidekiq/job/interrupt_handler.rb +22 -0
  24. data/lib/sidekiq/job/iterable/active_record_enumerator.rb +53 -0
  25. data/lib/sidekiq/job/iterable/csv_enumerator.rb +47 -0
  26. data/lib/sidekiq/job/iterable/enumerators.rb +135 -0
  27. data/lib/sidekiq/job/iterable.rb +231 -0
  28. data/lib/sidekiq/job.rb +385 -0
  29. data/lib/sidekiq/job_logger.rb +64 -0
  30. data/lib/sidekiq/job_retry.rb +305 -0
  31. data/lib/sidekiq/job_util.rb +107 -0
  32. data/lib/sidekiq/launcher.rb +241 -66
  33. data/lib/sidekiq/logger.rb +131 -0
  34. data/lib/sidekiq/manager.rb +91 -192
  35. data/lib/sidekiq/metrics/query.rb +156 -0
  36. data/lib/sidekiq/metrics/shared.rb +95 -0
  37. data/lib/sidekiq/metrics/tracking.rb +140 -0
  38. data/lib/sidekiq/middleware/chain.rb +114 -56
  39. data/lib/sidekiq/middleware/current_attributes.rb +111 -0
  40. data/lib/sidekiq/middleware/i18n.rb +8 -7
  41. data/lib/sidekiq/middleware/modules.rb +21 -0
  42. data/lib/sidekiq/monitor.rb +146 -0
  43. data/lib/sidekiq/paginator.rb +29 -16
  44. data/lib/sidekiq/processor.rb +248 -112
  45. data/lib/sidekiq/rails.rb +61 -27
  46. data/lib/sidekiq/redis_client_adapter.rb +114 -0
  47. data/lib/sidekiq/redis_connection.rb +68 -48
  48. data/lib/sidekiq/ring_buffer.rb +29 -0
  49. data/lib/sidekiq/scheduled.rb +173 -52
  50. data/lib/sidekiq/sd_notify.rb +149 -0
  51. data/lib/sidekiq/systemd.rb +24 -0
  52. data/lib/sidekiq/testing/inline.rb +7 -5
  53. data/lib/sidekiq/testing.rb +206 -65
  54. data/lib/sidekiq/transaction_aware_client.rb +51 -0
  55. data/lib/sidekiq/version.rb +4 -1
  56. data/lib/sidekiq/web/action.rb +99 -0
  57. data/lib/sidekiq/web/application.rb +479 -0
  58. data/lib/sidekiq/web/csrf_protection.rb +183 -0
  59. data/lib/sidekiq/web/helpers.rb +415 -0
  60. data/lib/sidekiq/web/router.rb +104 -0
  61. data/lib/sidekiq/web.rb +158 -200
  62. data/lib/sidekiq/worker_compatibility_alias.rb +13 -0
  63. data/lib/sidekiq.rb +100 -132
  64. data/sidekiq.gemspec +27 -23
  65. data/web/assets/images/apple-touch-icon.png +0 -0
  66. data/web/assets/images/favicon.ico +0 -0
  67. data/web/assets/javascripts/application.js +177 -72
  68. data/web/assets/javascripts/base-charts.js +106 -0
  69. data/web/assets/javascripts/chart.min.js +13 -0
  70. data/web/assets/javascripts/chartjs-plugin-annotation.min.js +7 -0
  71. data/web/assets/javascripts/dashboard-charts.js +192 -0
  72. data/web/assets/javascripts/dashboard.js +37 -286
  73. data/web/assets/javascripts/metrics.js +298 -0
  74. data/web/assets/stylesheets/application-dark.css +147 -0
  75. data/web/assets/stylesheets/application-rtl.css +163 -0
  76. data/web/assets/stylesheets/application.css +228 -247
  77. data/web/assets/stylesheets/bootstrap-rtl.min.css +9 -0
  78. data/web/assets/stylesheets/bootstrap.css +4 -8
  79. data/web/locales/ar.yml +87 -0
  80. data/web/locales/cs.yml +62 -52
  81. data/web/locales/da.yml +60 -53
  82. data/web/locales/de.yml +65 -53
  83. data/web/locales/el.yml +43 -24
  84. data/web/locales/en.yml +86 -61
  85. data/web/locales/es.yml +70 -53
  86. data/web/locales/fa.yml +80 -0
  87. data/web/locales/fr.yml +86 -56
  88. data/web/locales/gd.yml +99 -0
  89. data/web/locales/he.yml +80 -0
  90. data/web/locales/hi.yml +59 -59
  91. data/web/locales/it.yml +53 -53
  92. data/web/locales/ja.yml +78 -56
  93. data/web/locales/ko.yml +52 -52
  94. data/web/locales/lt.yml +83 -0
  95. data/web/locales/{no.yml → nb.yml} +62 -54
  96. data/web/locales/nl.yml +52 -52
  97. data/web/locales/pl.yml +45 -45
  98. data/web/locales/pt-br.yml +83 -55
  99. data/web/locales/pt.yml +51 -51
  100. data/web/locales/ru.yml +68 -60
  101. data/web/locales/sv.yml +53 -53
  102. data/web/locales/ta.yml +60 -60
  103. data/web/locales/tr.yml +101 -0
  104. data/web/locales/uk.yml +77 -0
  105. data/web/locales/ur.yml +80 -0
  106. data/web/locales/vi.yml +83 -0
  107. data/web/locales/zh-cn.yml +43 -16
  108. data/web/locales/zh-tw.yml +42 -8
  109. data/web/views/_footer.erb +22 -9
  110. data/web/views/_job_info.erb +27 -6
  111. data/web/views/_metrics_period_select.erb +12 -0
  112. data/web/views/_nav.erb +8 -22
  113. data/web/views/_paging.erb +3 -1
  114. data/web/views/_poll_link.erb +4 -0
  115. data/web/views/_summary.erb +7 -7
  116. data/web/views/busy.erb +91 -31
  117. data/web/views/dashboard.erb +52 -22
  118. data/web/views/dead.erb +5 -4
  119. data/web/views/filtering.erb +7 -0
  120. data/web/views/layout.erb +19 -7
  121. data/web/views/metrics.erb +91 -0
  122. data/web/views/metrics_for_job.erb +59 -0
  123. data/web/views/morgue.erb +26 -20
  124. data/web/views/queue.erb +36 -25
  125. data/web/views/queues.erb +24 -7
  126. data/web/views/retries.erb +29 -21
  127. data/web/views/retry.erb +6 -5
  128. data/web/views/scheduled.erb +20 -17
  129. data/web/views/scheduled_job_info.erb +2 -1
  130. metadata +101 -232
  131. data/.gitignore +0 -12
  132. data/.travis.yml +0 -16
  133. data/3.0-Upgrade.md +0 -70
  134. data/COMM-LICENSE +0 -85
  135. data/Contributing.md +0 -32
  136. data/Gemfile +0 -22
  137. data/LICENSE +0 -9
  138. data/Pro-2.0-Upgrade.md +0 -138
  139. data/Pro-Changes.md +0 -412
  140. data/Rakefile +0 -9
  141. data/bin/sidekiqctl +0 -93
  142. data/lib/generators/sidekiq/templates/worker_spec.rb.erb +0 -6
  143. data/lib/generators/sidekiq/templates/worker_test.rb.erb +0 -8
  144. data/lib/generators/sidekiq/worker_generator.rb +0 -49
  145. data/lib/sidekiq/actor.rb +0 -39
  146. data/lib/sidekiq/core_ext.rb +0 -105
  147. data/lib/sidekiq/exception_handler.rb +0 -30
  148. data/lib/sidekiq/extensions/action_mailer.rb +0 -56
  149. data/lib/sidekiq/extensions/active_record.rb +0 -39
  150. data/lib/sidekiq/extensions/class_methods.rb +0 -39
  151. data/lib/sidekiq/extensions/generic_proxy.rb +0 -24
  152. data/lib/sidekiq/logging.rb +0 -104
  153. data/lib/sidekiq/middleware/server/active_record.rb +0 -13
  154. data/lib/sidekiq/middleware/server/logging.rb +0 -35
  155. data/lib/sidekiq/middleware/server/retry_jobs.rb +0 -206
  156. data/lib/sidekiq/util.rb +0 -55
  157. data/lib/sidekiq/web_helpers.rb +0 -234
  158. data/lib/sidekiq/worker.rb +0 -89
  159. data/test/config.yml +0 -9
  160. data/test/env_based_config.yml +0 -11
  161. data/test/fake_env.rb +0 -0
  162. data/test/fixtures/en.yml +0 -2
  163. data/test/helper.rb +0 -39
  164. data/test/test_api.rb +0 -494
  165. data/test/test_cli.rb +0 -365
  166. data/test/test_client.rb +0 -269
  167. data/test/test_exception_handler.rb +0 -55
  168. data/test/test_extensions.rb +0 -120
  169. data/test/test_fetch.rb +0 -104
  170. data/test/test_logging.rb +0 -34
  171. data/test/test_manager.rb +0 -164
  172. data/test/test_middleware.rb +0 -159
  173. data/test/test_processor.rb +0 -166
  174. data/test/test_redis_connection.rb +0 -127
  175. data/test/test_retry.rb +0 -373
  176. data/test/test_scheduled.rb +0 -120
  177. data/test/test_scheduling.rb +0 -71
  178. data/test/test_sidekiq.rb +0 -69
  179. data/test/test_testing.rb +0 -82
  180. data/test/test_testing_fake.rb +0 -271
  181. data/test/test_testing_inline.rb +0 -93
  182. data/test/test_web.rb +0 -594
  183. data/test/test_web_helpers.rb +0 -52
  184. data/test/test_worker_generator.rb +0 -17
  185. data/web/assets/images/bootstrap/glyphicons-halflings-white.png +0 -0
  186. data/web/assets/images/bootstrap/glyphicons-halflings.png +0 -0
  187. data/web/assets/images/status/active.png +0 -0
  188. data/web/assets/images/status/idle.png +0 -0
  189. data/web/assets/javascripts/locales/README.md +0 -27
  190. data/web/assets/javascripts/locales/jquery.timeago.ar.js +0 -96
  191. data/web/assets/javascripts/locales/jquery.timeago.bg.js +0 -18
  192. data/web/assets/javascripts/locales/jquery.timeago.bs.js +0 -49
  193. data/web/assets/javascripts/locales/jquery.timeago.ca.js +0 -18
  194. data/web/assets/javascripts/locales/jquery.timeago.cs.js +0 -18
  195. data/web/assets/javascripts/locales/jquery.timeago.cy.js +0 -20
  196. data/web/assets/javascripts/locales/jquery.timeago.da.js +0 -18
  197. data/web/assets/javascripts/locales/jquery.timeago.de.js +0 -18
  198. data/web/assets/javascripts/locales/jquery.timeago.el.js +0 -18
  199. data/web/assets/javascripts/locales/jquery.timeago.en-short.js +0 -20
  200. data/web/assets/javascripts/locales/jquery.timeago.en.js +0 -20
  201. data/web/assets/javascripts/locales/jquery.timeago.es.js +0 -18
  202. data/web/assets/javascripts/locales/jquery.timeago.et.js +0 -18
  203. data/web/assets/javascripts/locales/jquery.timeago.fa.js +0 -22
  204. data/web/assets/javascripts/locales/jquery.timeago.fi.js +0 -28
  205. data/web/assets/javascripts/locales/jquery.timeago.fr-short.js +0 -16
  206. data/web/assets/javascripts/locales/jquery.timeago.fr.js +0 -17
  207. data/web/assets/javascripts/locales/jquery.timeago.he.js +0 -18
  208. data/web/assets/javascripts/locales/jquery.timeago.hr.js +0 -49
  209. data/web/assets/javascripts/locales/jquery.timeago.hu.js +0 -18
  210. data/web/assets/javascripts/locales/jquery.timeago.hy.js +0 -18
  211. data/web/assets/javascripts/locales/jquery.timeago.id.js +0 -18
  212. data/web/assets/javascripts/locales/jquery.timeago.it.js +0 -16
  213. data/web/assets/javascripts/locales/jquery.timeago.ja.js +0 -19
  214. data/web/assets/javascripts/locales/jquery.timeago.ko.js +0 -17
  215. data/web/assets/javascripts/locales/jquery.timeago.lt.js +0 -20
  216. data/web/assets/javascripts/locales/jquery.timeago.mk.js +0 -20
  217. data/web/assets/javascripts/locales/jquery.timeago.nl.js +0 -20
  218. data/web/assets/javascripts/locales/jquery.timeago.no.js +0 -18
  219. data/web/assets/javascripts/locales/jquery.timeago.pl.js +0 -31
  220. data/web/assets/javascripts/locales/jquery.timeago.pt-br.js +0 -16
  221. data/web/assets/javascripts/locales/jquery.timeago.pt.js +0 -16
  222. data/web/assets/javascripts/locales/jquery.timeago.ro.js +0 -18
  223. data/web/assets/javascripts/locales/jquery.timeago.rs.js +0 -49
  224. data/web/assets/javascripts/locales/jquery.timeago.ru.js +0 -34
  225. data/web/assets/javascripts/locales/jquery.timeago.sk.js +0 -18
  226. data/web/assets/javascripts/locales/jquery.timeago.sl.js +0 -44
  227. data/web/assets/javascripts/locales/jquery.timeago.sv.js +0 -18
  228. data/web/assets/javascripts/locales/jquery.timeago.th.js +0 -20
  229. data/web/assets/javascripts/locales/jquery.timeago.tr.js +0 -16
  230. data/web/assets/javascripts/locales/jquery.timeago.uk.js +0 -34
  231. data/web/assets/javascripts/locales/jquery.timeago.uz.js +0 -19
  232. data/web/assets/javascripts/locales/jquery.timeago.zh-cn.js +0 -20
  233. data/web/assets/javascripts/locales/jquery.timeago.zh-tw.js +0 -20
  234. data/web/views/_poll.erb +0 -10
  235. /data/web/assets/images/{status-sd8051fd480.png → status.png} +0 -0
@@ -0,0 +1,298 @@
1
+ class JobMetricsOverviewChart extends BaseChart {
2
+ constructor(el, options) {
3
+ super(el, { ...options, chartType: "line" });
4
+ this.swatches = [];
5
+ this.visibleKls = options.visibleKls;
6
+
7
+ const countBuckets = this.options.labels.length / 60;
8
+ this.labelBuckets = this.options.labels.reduce((acc, label, index) => {
9
+ const bucket = Math.floor(index / countBuckets);
10
+ acc[bucket] = acc[bucket] || [];
11
+ acc[bucket].push(label);
12
+ return acc;
13
+ }, []);
14
+
15
+ this.init();
16
+ }
17
+
18
+ get datasets() {
19
+ return Object.entries(this.options.series)
20
+ .filter(([kls, _]) => this.visibleKls.includes(kls))
21
+ .map(([kls, _]) => this.buildDataset(kls));
22
+ }
23
+
24
+ get metric() {
25
+ return this._metric || this.options.initialMetric;
26
+ }
27
+
28
+ set metric(m) {
29
+ this._metric = m;
30
+ }
31
+
32
+ registerSwatch(id) {
33
+ const el = document.getElementById(id);
34
+ el.addEventListener("change", () => this.toggleKls(el.value, el.checked));
35
+ this.swatches[el.value] = el;
36
+ this.updateSwatch(el.value, el.checked);
37
+ }
38
+
39
+ updateSwatch(kls, checked) {
40
+ const el = this.swatches[kls];
41
+ el.checked = checked;
42
+ el.style.color = this.colors.assignments[kls] || "";
43
+ }
44
+
45
+ toggleKls(kls, visible) {
46
+ if (visible) {
47
+ this.chart.data.datasets.push(this.buildDataset(kls));
48
+ } else {
49
+ const i = this.chart.data.datasets.findIndex((ds) => ds.label == kls);
50
+ this.colors.checkIn(kls);
51
+ this.chart.data.datasets.splice(i, 1);
52
+ }
53
+
54
+ this.updateSwatch(kls, visible);
55
+ this.update();
56
+ }
57
+
58
+ buildDataset(kls) {
59
+ const color = this.colors.checkOut(kls);
60
+
61
+ return {
62
+ label: kls,
63
+ data: this.buildSeries(kls),
64
+ borderColor: color,
65
+ backgroundColor: color,
66
+ borderWidth: 2,
67
+ pointRadius: 2,
68
+ };
69
+ }
70
+
71
+ buildSeries(kls) {
72
+ // `series` is an object that maps labels to counts => { "20:15" => 2, "20:16" => 3, ... }
73
+ const series = this.options.series[kls];
74
+ return this.labelBuckets.reduce((acc, labels) => {
75
+ const bucketValues = labels.map(label => series[label]).filter(v => v);
76
+ if (bucketValues.length > 0) {
77
+ // Sum up the values for each bucket that has data.
78
+ // The new label is the bucket's first label, its start time.
79
+ acc[labels[0]] = bucketValues.reduce((a, b) => a + b, 0);
80
+ }
81
+ return acc;
82
+ }, {});
83
+ }
84
+
85
+ buildTooltipTitle(items) {
86
+ const [first, ...rest] = this.labelBuckets.find((labels) => labels[0] === items[0].label);
87
+ const title = [first, rest[rest.length - 1]].filter(v => v).join(" - ");
88
+ return `${title} UTC`
89
+ }
90
+
91
+ get chartOptions() {
92
+ return {
93
+ ...super.chartOptions,
94
+ aspectRatio: 4,
95
+ scales: {
96
+ ...super.chartOptions.scales,
97
+ y: {
98
+ ...super.chartOptions.scales.y,
99
+ beginAtZero: true,
100
+ title: {
101
+ text: this.options.yLabel,
102
+ display: true,
103
+ },
104
+ },
105
+ },
106
+ plugins: {
107
+ ...super.chartOptions.plugins,
108
+ tooltip: {
109
+ ...super.chartOptions.plugins.tooltip,
110
+ callbacks: {
111
+ title: (items) => this.buildTooltipTitle(items),
112
+ label: (item) =>
113
+ `${item.dataset.label}: ${item.parsed.y.toFixed(1)} ` +
114
+ `${this.options.units}`,
115
+ footer: (items) => {
116
+ const bucket = items[0].label;
117
+ const marks = this.options.marks.filter(([b, _]) => b == bucket);
118
+ return marks.map(
119
+ ([b, msg]) => `${this.options.markLabel}: ${msg}`
120
+ );
121
+ },
122
+ },
123
+ },
124
+ },
125
+ };
126
+ }
127
+ }
128
+
129
+ class HistTotalsChart extends BaseChart {
130
+ constructor(el, options) {
131
+ super(el, { ...options, chartType: "bar" });
132
+ this.init();
133
+ }
134
+
135
+ get datasets() {
136
+ return [
137
+ {
138
+ data: this.options.series,
139
+ backgroundColor: this.colors.primary,
140
+ borderWidth: 0,
141
+ },
142
+ ];
143
+ }
144
+
145
+ get chartOptions() {
146
+ return {
147
+ ...super.chartOptions,
148
+ aspectRatio: 6,
149
+ scales: {
150
+ ...super.chartOptions.scales,
151
+ y: {
152
+ ...super.chartOptions.scales.y,
153
+ beginAtZero: true,
154
+ title: {
155
+ text: this.options.yLabel,
156
+ display: true,
157
+ },
158
+ },
159
+ x: {
160
+ ...super.chartOptions.scales.x,
161
+ title: {
162
+ text: this.options.xLabel,
163
+ display: true,
164
+ },
165
+ },
166
+ },
167
+ plugins: {
168
+ ...super.chartOptions.plugins,
169
+ tooltip: {
170
+ ...super.chartOptions.plugins.tooltip,
171
+ callbacks: {
172
+ label: (item) => `${item.parsed.y} ${this.options.units}`,
173
+ },
174
+ },
175
+ },
176
+ };
177
+ }
178
+ }
179
+
180
+ class HistBubbleChart extends BaseChart {
181
+ constructor(el, options) {
182
+ super(el, { ...options, chartType: "bubble" });
183
+ this.init();
184
+ }
185
+
186
+ get datasets() {
187
+ const data = [];
188
+ let maxCount = 0;
189
+
190
+ Object.entries(this.options.hist).forEach(([bucket, hist]) => {
191
+ hist.forEach((count, histBucket) => {
192
+ if (count > 0) {
193
+ // histogram data is ordered fastest to slowest, but this.histIntervals is
194
+ // slowest to fastest (so it displays correctly on the chart).
195
+ const index = this.options.histIntervals.length - 1 - histBucket;
196
+
197
+ data.push({
198
+ x: bucket,
199
+ y: this.options.histIntervals[index] / 1000,
200
+ count: count,
201
+ });
202
+
203
+ if (count > maxCount) maxCount = count;
204
+ }
205
+ });
206
+ });
207
+
208
+ // Chart.js will not calculate the bubble size. We have to do that.
209
+ const maxRadius = this.el.offsetWidth / this.options.labels.length;
210
+ const minRadius = 1;
211
+ const multiplier = (maxRadius / maxCount) * 1.5;
212
+ data.forEach((entry) => {
213
+ entry.r = entry.count * multiplier + minRadius;
214
+ });
215
+
216
+ return [
217
+ {
218
+ data: data,
219
+ backgroundColor: this.colors.primary,
220
+ borderColor: this.colors.primary,
221
+ },
222
+ ];
223
+ }
224
+
225
+ get chartOptions() {
226
+ return {
227
+ ...super.chartOptions,
228
+ aspectRatio: 3,
229
+ scales: {
230
+ ...super.chartOptions.scales,
231
+ x: {
232
+ ...super.chartOptions.scales.x,
233
+ type: "category",
234
+ labels: this.options.labels,
235
+ },
236
+ y: {
237
+ ...super.chartOptions.scales.y,
238
+ title: {
239
+ text: this.options.yLabel,
240
+ display: true,
241
+ },
242
+ },
243
+ },
244
+ plugins: {
245
+ ...super.chartOptions.plugins,
246
+ tooltip: {
247
+ ...super.chartOptions.plugins.tooltip,
248
+ callbacks: {
249
+ title: (items) => `${items[0].raw.x} UTC`,
250
+ label: (item) =>
251
+ `${item.parsed.y} ${this.options.yUnits}: ${item.raw.count} ${this.options.zUnits}`,
252
+ footer: (items) => {
253
+ const bucket = items[0].raw.x;
254
+ const marks = this.options.marks.filter(([b, _]) => b == bucket);
255
+ return marks.map(
256
+ ([b, msg]) => `${this.options.markLabel}: ${msg}`
257
+ );
258
+ },
259
+ },
260
+ },
261
+ },
262
+ };
263
+ }
264
+ }
265
+
266
+ var ch = document.getElementById("job-metrics-overview-chart");
267
+ if (ch != null) {
268
+ var jm = new JobMetricsOverviewChart(ch, JSON.parse(ch.textContent));
269
+ document.querySelectorAll(".metrics-swatch-wrapper > input[type=checkbox]").forEach((imp) => {
270
+ jm.registerSwatch(imp.id)
271
+ });
272
+ window.jobMetricsChart = jm;
273
+ }
274
+
275
+ var htc = document.getElementById("hist-totals-chart");
276
+ if (htc != null) {
277
+ var tc = new HistTotalsChart(htc, JSON.parse(htc.textContent));
278
+ window.histTotalsChart = tc
279
+ }
280
+
281
+ var hbc = document.getElementById("hist-bubble-chart");
282
+ if (hbc != null) {
283
+ var bc = new HistBubbleChart(hbc, JSON.parse(hbc.textContent));
284
+ window.histBubbleChart = bc
285
+ }
286
+
287
+ var form = document.getElementById("metrics-form")
288
+ document.querySelectorAll("#period-selector").forEach(node => {
289
+ node.addEventListener("input", debounce(() => form.submit()))
290
+ })
291
+
292
+ function debounce(func, timeout = 300) {
293
+ let timer;
294
+ return (...args) => {
295
+ clearTimeout(timer);
296
+ timer = setTimeout(() => { func.apply(this, args); }, timeout);
297
+ };
298
+ }
@@ -0,0 +1,147 @@
1
+ html, body {
2
+ background-color: #171717 !important;
3
+ color: #DEDEDE;
4
+ }
5
+
6
+ a,
7
+ .title,
8
+ .summary_bar ul .count,
9
+ span.current-interval,
10
+ .navbar .navbar-brand {
11
+ color: #d04;
12
+ }
13
+
14
+ .history-graph.active,
15
+ .beacon .dot {
16
+ background-color: #d04;
17
+ }
18
+
19
+ .navbar .navbar-brand:hover {
20
+ color: #ddd;
21
+ }
22
+
23
+ .navbar .navbar-brand .status {
24
+ color: #ddd;
25
+ }
26
+
27
+ .navbar-default .navbar-nav > li > a {
28
+ color: #ddd;
29
+ }
30
+
31
+ .navbar-inverse {
32
+ background-color: #222;
33
+ border-color: #444;
34
+ }
35
+
36
+ table {
37
+ background-color: #1D1D1D;
38
+ }
39
+
40
+ .table-striped > tbody > tr:nth-of-type(odd) {
41
+ background-color: #2E2E2E;
42
+ }
43
+
44
+ .table-bordered,
45
+ .table-bordered > tbody > tr > td,
46
+ .table-bordered > tbody > tr > th,
47
+ .table-bordered > tfoot > tr > td,
48
+ .table-bordered > tfoot > tr > th,
49
+ .table-bordered > thead > tr > td,
50
+ .table-bordered > thead > tr > th {
51
+ border: 1px solid #444;
52
+ }
53
+
54
+ .table-hover > tbody > tr:hover {
55
+ background-color: #444;
56
+ }
57
+
58
+ .alert {
59
+ border: none;
60
+ color: #ddd;
61
+ }
62
+
63
+ .alert-success {
64
+ background-color: #484;
65
+ }
66
+
67
+ .alert-danger {
68
+ background-color: #980035;
69
+ }
70
+
71
+ .alert-info {
72
+ background-color: #31708f;
73
+ }
74
+
75
+ .alert-warning {
76
+ background-color: #c47612;
77
+ }
78
+
79
+ a:link, a:active, a:hover, a:visited {
80
+ color: #ddd;
81
+ }
82
+
83
+ input {
84
+ background-color: #444;
85
+ color: #ccc;
86
+ padding: 3px;
87
+ }
88
+
89
+ .summary_bar .summary {
90
+ background-color: #232323;
91
+ border: 1px solid #444;
92
+ }
93
+
94
+ .navbar-default {
95
+ background-color: #0F0F0F;
96
+ border-color: #444;
97
+ }
98
+
99
+ .navbar-default .navbar-nav > .active > a,
100
+ .navbar-default .navbar-nav > .active > a:focus,
101
+ .navbar-default .navbar-nav > .active > a:hover {
102
+ color: #ddd;
103
+ background-color: #333;
104
+ }
105
+
106
+ .navbar-default .navbar-nav > li > a:hover {
107
+ color: #ddd;
108
+ }
109
+
110
+ .pagination > li > a,
111
+ .pagination > li > a:hover,
112
+ .pagination > li > span {
113
+ color: #ddd;
114
+ background-color: #333;
115
+ border-color: #444;
116
+ }
117
+ .pagination > .disabled > a,
118
+ .pagination > .disabled > a:focus,
119
+ .pagination > .disabled > a:hover,
120
+ .pagination > .disabled > span,
121
+ .pagination > .disabled > span:focus,
122
+ .pagination > .disabled > span:hover {
123
+ color: #ddd;
124
+ background-color: #333;
125
+ border-color: #444;
126
+ }
127
+
128
+ .stat {
129
+ border: 1px solid #888;
130
+ }
131
+
132
+ .rickshaw_graph .detail {
133
+ background: #888;
134
+ }
135
+ .rickshaw_graph .x_tick {
136
+ border-color: #888;
137
+ }
138
+
139
+ .rickshaw_graph .y_ticks.glow text {
140
+ fill: #ddd;
141
+ color: #ddd;
142
+ }
143
+
144
+ .info-circle {
145
+ color: #222;
146
+ background-color: #888;
147
+ }
@@ -0,0 +1,163 @@
1
+ .navbar-right {
2
+ float: left !important;
3
+ }
4
+
5
+ footer .edits {
6
+ margin-right: unset;
7
+ margin-left: 40px;
8
+ }
9
+
10
+ .summary_bar .status {
11
+ margin-left: unset;
12
+ margin-right: 10px;
13
+ }
14
+ @media (max-width: 767px) and (min-width: 400px) {
15
+ .summary_bar ul .desc {
16
+ text-align: right;
17
+ }
18
+ .summary_bar ul .count {
19
+ text-align: left;
20
+ }
21
+ }
22
+ @media (max-width: 979px) and (min-width: 768px) {
23
+ }
24
+ .summary_bar ul .count {
25
+ float: left;
26
+ }
27
+
28
+ form .btn {
29
+ margin-right: unset;
30
+ margin-left: 5px;
31
+ }
32
+
33
+ form .btn-group .btn {
34
+ margin-right: unset;
35
+ margin-left: 1px;
36
+ }
37
+
38
+ @media (max-width: 768px) {
39
+ .navbar.navbar-fixed-top ul {
40
+ margin-right: unset;
41
+ margin-left: -15px!important;
42
+ }
43
+ }
44
+
45
+ @media (width: 768px) {
46
+ .navbar .poll-wrapper {
47
+ margin: 4px 0 0 4px;
48
+ }
49
+ }
50
+
51
+ .navbar-footer .navbar ul.nav a.navbar-brand {
52
+ padding: 0 0 0 15px;
53
+ }
54
+
55
+ .navbar-fixed-bottom li {
56
+ margin-right: unset;
57
+ margin-left: 20px;
58
+ }
59
+
60
+ .status-active {
61
+ background-position: 100% 0;
62
+ }
63
+
64
+ .status-idle {
65
+ background-position: 100% -54px;
66
+ }
67
+
68
+ .stat {
69
+ float: right;
70
+ margin-right: unset;
71
+ margin-left: 20px;
72
+ }
73
+
74
+ .stat:last-child {
75
+ margin-left: 0;
76
+ }
77
+
78
+ @media (max-width: 767px) {
79
+ .stat {
80
+ float: right;
81
+ margin-right: unset;
82
+ margin-left: 10px;
83
+ text-align: right;
84
+ }
85
+ .stat h3{
86
+ float: left;
87
+ margin: 5px 5px 5px 10px;
88
+ }
89
+ .stat p{
90
+ font-size: 1em;
91
+ margin: 5px 10px 5px 5px;
92
+ }
93
+ }
94
+
95
+ /* Dashboard
96
+ ********************************** */
97
+ div.dashboard h3 {
98
+ float: right;
99
+ }
100
+
101
+ div.interval-slider {
102
+ float: left;
103
+ }
104
+
105
+ #realtime-legend {
106
+ justify-content: start;
107
+ }
108
+
109
+ /* Beacon
110
+ ********************************** */
111
+
112
+ .beacon .dot,
113
+ .beacon .ring {
114
+ right: 50%;
115
+ }
116
+
117
+ .beacon .dot {
118
+ margin: -5px -5px 0 0;
119
+ }
120
+
121
+ .beacon .ring {
122
+ margin: -14px -14px 0 0;
123
+ }
124
+
125
+ .history-heading {
126
+ padding-right: unset;
127
+ padding-left: 15px;
128
+ }
129
+
130
+ @media (max-width: 767px) {
131
+ .navbar.navbar-fixed-top ul {
132
+ margin-left: 0;
133
+ }
134
+
135
+ .navbar.navbar-fixed-top li {
136
+ margin-left: 0;
137
+ }
138
+
139
+ .navbar.navbar-fixed-bottom ul {
140
+ margin-left: 0;
141
+ }
142
+
143
+ .navbar.navbar-fixed-bottom li {
144
+ margin-left: 0;
145
+ }
146
+ }
147
+
148
+ @media (max-width: 500px) {
149
+ .navbar-footer .navbar ul.nav a.navbar-brand {
150
+ padding-right: unset;
151
+ padding-left: 5px;
152
+ }
153
+ }
154
+
155
+ #locale-select {
156
+ float: right;
157
+ }
158
+
159
+ @media (max-width: 767px) {
160
+ #locale-select {
161
+ float: none;
162
+ }
163
+ }