pghero_fork 2.7.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +391 -0
  3. data/CONTRIBUTING.md +42 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +3 -0
  6. data/app/assets/images/pghero/favicon.png +0 -0
  7. data/app/assets/javascripts/pghero/Chart.bundle.js +20755 -0
  8. data/app/assets/javascripts/pghero/application.js +158 -0
  9. data/app/assets/javascripts/pghero/chartkick.js +2436 -0
  10. data/app/assets/javascripts/pghero/highlight.pack.js +2 -0
  11. data/app/assets/javascripts/pghero/jquery.js +10872 -0
  12. data/app/assets/javascripts/pghero/nouislider.js +2672 -0
  13. data/app/assets/stylesheets/pghero/application.css +514 -0
  14. data/app/assets/stylesheets/pghero/arduino-light.css +86 -0
  15. data/app/assets/stylesheets/pghero/nouislider.css +310 -0
  16. data/app/controllers/pg_hero/home_controller.rb +449 -0
  17. data/app/helpers/pg_hero/home_helper.rb +30 -0
  18. data/app/views/layouts/pg_hero/application.html.erb +68 -0
  19. data/app/views/pg_hero/home/_connections_table.html.erb +16 -0
  20. data/app/views/pg_hero/home/_live_queries_table.html.erb +51 -0
  21. data/app/views/pg_hero/home/_queries_table.html.erb +72 -0
  22. data/app/views/pg_hero/home/_query_stats_slider.html.erb +16 -0
  23. data/app/views/pg_hero/home/_suggested_index.html.erb +18 -0
  24. data/app/views/pg_hero/home/connections.html.erb +32 -0
  25. data/app/views/pg_hero/home/explain.html.erb +27 -0
  26. data/app/views/pg_hero/home/index.html.erb +518 -0
  27. data/app/views/pg_hero/home/index_bloat.html.erb +72 -0
  28. data/app/views/pg_hero/home/live_queries.html.erb +11 -0
  29. data/app/views/pg_hero/home/maintenance.html.erb +55 -0
  30. data/app/views/pg_hero/home/queries.html.erb +33 -0
  31. data/app/views/pg_hero/home/relation_space.html.erb +14 -0
  32. data/app/views/pg_hero/home/show_query.html.erb +106 -0
  33. data/app/views/pg_hero/home/space.html.erb +83 -0
  34. data/app/views/pg_hero/home/system.html.erb +34 -0
  35. data/app/views/pg_hero/home/tune.html.erb +53 -0
  36. data/config/routes.rb +32 -0
  37. data/lib/generators/pghero/config_generator.rb +13 -0
  38. data/lib/generators/pghero/query_stats_generator.rb +18 -0
  39. data/lib/generators/pghero/space_stats_generator.rb +18 -0
  40. data/lib/generators/pghero/templates/config.yml.tt +46 -0
  41. data/lib/generators/pghero/templates/query_stats.rb.tt +15 -0
  42. data/lib/generators/pghero/templates/space_stats.rb.tt +13 -0
  43. data/lib/pghero.rb +246 -0
  44. data/lib/pghero/connection.rb +5 -0
  45. data/lib/pghero/database.rb +175 -0
  46. data/lib/pghero/engine.rb +16 -0
  47. data/lib/pghero/methods/basic.rb +160 -0
  48. data/lib/pghero/methods/connections.rb +77 -0
  49. data/lib/pghero/methods/constraints.rb +30 -0
  50. data/lib/pghero/methods/explain.rb +29 -0
  51. data/lib/pghero/methods/indexes.rb +332 -0
  52. data/lib/pghero/methods/kill.rb +28 -0
  53. data/lib/pghero/methods/maintenance.rb +93 -0
  54. data/lib/pghero/methods/queries.rb +75 -0
  55. data/lib/pghero/methods/query_stats.rb +349 -0
  56. data/lib/pghero/methods/replication.rb +74 -0
  57. data/lib/pghero/methods/sequences.rb +124 -0
  58. data/lib/pghero/methods/settings.rb +37 -0
  59. data/lib/pghero/methods/space.rb +141 -0
  60. data/lib/pghero/methods/suggested_indexes.rb +329 -0
  61. data/lib/pghero/methods/system.rb +287 -0
  62. data/lib/pghero/methods/tables.rb +68 -0
  63. data/lib/pghero/methods/users.rb +87 -0
  64. data/lib/pghero/query_stats.rb +5 -0
  65. data/lib/pghero/space_stats.rb +5 -0
  66. data/lib/pghero/stats.rb +6 -0
  67. data/lib/pghero/version.rb +3 -0
  68. data/lib/tasks/pghero.rake +27 -0
  69. data/licenses/LICENSE-chart.js.txt +9 -0
  70. data/licenses/LICENSE-chartkick.js.txt +22 -0
  71. data/licenses/LICENSE-highlight.js.txt +29 -0
  72. data/licenses/LICENSE-jquery.txt +20 -0
  73. data/licenses/LICENSE-moment.txt +22 -0
  74. data/licenses/LICENSE-nouislider.txt +21 -0
  75. metadata +130 -0
@@ -0,0 +1,514 @@
1
+ /*
2
+ *= require ./nouislider
3
+ *= require ./arduino-light
4
+ *= require_self
5
+ */
6
+
7
+ html {
8
+ box-sizing: border-box;
9
+ font-size: 14px;
10
+ }
11
+
12
+ *, *:before, *:after {
13
+ box-sizing: inherit;
14
+ }
15
+
16
+ body {
17
+ margin: 0;
18
+ padding: 20px;
19
+ background-color: #eee;
20
+ }
21
+
22
+ body {
23
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
24
+ line-height: 1.4;
25
+ color: #333;
26
+ }
27
+
28
+ a, a:visited, a:active {
29
+ color: #428bca;
30
+ text-decoration: none;
31
+ }
32
+
33
+ a:hover {
34
+ text-decoration: underline;
35
+ }
36
+
37
+ table {
38
+ width: 100%;
39
+ border-collapse: collapse;
40
+ border-spacing: 0;
41
+ table-layout: fixed;
42
+ }
43
+
44
+ th {
45
+ text-align: left;
46
+ border-bottom: solid 2px #ddd;
47
+ }
48
+
49
+ h1 {
50
+ font-size: 20px;
51
+ font-weight: bold;
52
+ }
53
+
54
+ h2 {
55
+ font-size: 16px;
56
+ font-weight: bold;
57
+ }
58
+
59
+ h1 small {
60
+ font-weight: normal;
61
+ font-size: 14px;
62
+ color: #999;
63
+ }
64
+
65
+ h1, h2, p, ul, hr, table, pre {
66
+ margin-top: 0;
67
+ margin-bottom: 1rem;
68
+ }
69
+
70
+ .field {
71
+ margin-bottom: 0.5rem;
72
+ }
73
+
74
+ h3 {
75
+ text-align: center;
76
+ }
77
+
78
+ ul {
79
+ list-style-type: disc;
80
+ padding-left: 20px;
81
+ }
82
+
83
+ ul.nav {
84
+ list-style-type: none;
85
+ padding: 0;
86
+ margin: 0;
87
+ }
88
+
89
+ table td, table th {
90
+ padding: 8px;
91
+ }
92
+
93
+ td {
94
+ border-top: solid 1px #ddd;
95
+ vertical-align: top;
96
+ }
97
+
98
+ pre {
99
+ background-color: #eee;
100
+ padding: 10px;
101
+ white-space: pre-wrap;
102
+ word-break: break-word;
103
+ margin-top: 0;
104
+ }
105
+
106
+ textarea {
107
+ width: 100%;
108
+ height: 120px;
109
+ border: solid 1px #ddd;
110
+ padding: 10px;
111
+ font-size: inherit;
112
+ }
113
+
114
+ hr {
115
+ border: none;
116
+ height: 0;
117
+ border-top: solid 1px #ddd;
118
+ }
119
+
120
+ .container {
121
+ max-width: 1000px;
122
+ margin-left: auto;
123
+ margin-right: auto;
124
+ }
125
+
126
+ .text-muted {
127
+ color: #999;
128
+ }
129
+
130
+ .text-right {
131
+ text-align: right;
132
+ }
133
+
134
+ .percent {
135
+ color: #999;
136
+ font-size: 12px;
137
+ margin-left: 6px;
138
+ }
139
+
140
+ .btn-explain {
141
+ background: none;
142
+ border: none;
143
+ padding: 0;
144
+ font: inherit;
145
+ cursor: pointer;
146
+ color: #999;
147
+ font-size: 12px;
148
+ line-height: 20px;
149
+ margin-left: 6px;
150
+ }
151
+
152
+ .btn-explain:hover {
153
+ text-decoration: underline;
154
+ }
155
+
156
+ .user {
157
+ color: #999;
158
+ font-size: 12px;
159
+ float: right;
160
+ line-height: 20px;
161
+ }
162
+
163
+ .user a {
164
+ color: inherit;
165
+ }
166
+
167
+ .tiny {
168
+ font-size: 12px;
169
+ margin-left: 6px;
170
+ }
171
+
172
+ #status, .content, .alert {
173
+ margin-bottom: 20px;
174
+ }
175
+
176
+ .content {
177
+ padding: 20px 20px 1px 20px;
178
+ background-color: #fff;
179
+ }
180
+
181
+ .queries td {
182
+ vertical-align: middle;
183
+ }
184
+
185
+ #status div {
186
+ margin-bottom: 0;
187
+ }
188
+
189
+ #slider-container {
190
+ padding: 6px 140px 20px 140px;
191
+ }
192
+
193
+ .queries-table th a, .space-table th a {
194
+ color: inherit;
195
+ }
196
+
197
+ #slider {
198
+ margin-bottom: 20px;
199
+ }
200
+
201
+ #range-start {
202
+ min-height: 20px;
203
+ }
204
+
205
+ #range-end {
206
+ float: right;
207
+ }
208
+
209
+ .queries-info {
210
+ text-align: center;
211
+ margin-top: 40px;
212
+ }
213
+
214
+ /* nav */
215
+
216
+ .nav a {
217
+ color: #333;
218
+ text-decoration: none;
219
+ display: block;
220
+ padding: 12px 20px;
221
+ }
222
+
223
+ .nav li.active a {
224
+ background-color: #ddd;
225
+ }
226
+
227
+ .nav a:hover {
228
+ background-color: #ddd;
229
+ }
230
+
231
+ .nav li.active-database a {
232
+ color: #999;
233
+ }
234
+
235
+ .nav-header {
236
+ font-weight: bold;
237
+ color: #333;
238
+ padding: 12px 20px 12px 0;
239
+ margin: 0;
240
+ }
241
+
242
+ /* buttons */
243
+
244
+ .btn {
245
+ display: inline-block;
246
+ border: none;
247
+ color: #fff;
248
+ padding: 12px 20px;
249
+ font-size: inherit;
250
+ font-family: inherit;
251
+ line-height: 1;
252
+ cursor: pointer;
253
+ outline: none;
254
+ margin: 0;
255
+ -webkit-appearance: none;
256
+ -webkit-border-radius: 0;
257
+ }
258
+
259
+ .btn-danger {
260
+ background-color: #d9534f;
261
+ }
262
+
263
+ .btn-info {
264
+ background-color: #5bc0de;
265
+ }
266
+
267
+ /* alerts */
268
+
269
+ .alert {
270
+ padding: 12px 20px;
271
+ color: #fff;
272
+ }
273
+
274
+ .alert-info {
275
+ background-color: #5bc0de;
276
+ }
277
+
278
+ .alert-success {
279
+ background-color: #5cb85c;
280
+ }
281
+
282
+ .alert-warning {
283
+ background-color: #f0ad4e;
284
+ }
285
+
286
+ .alert-danger {
287
+ background-color: #d9534f;
288
+ }
289
+
290
+ .alert a {
291
+ color: #fff;
292
+ text-decoration: none;
293
+ }
294
+
295
+ .button_to, .button_to div {
296
+ display: inline;
297
+ }
298
+
299
+ /*
300
+ Simple Grid
301
+ Learn More - http://dallasbass.com/simple-grid-a-lightweight-responsive-css-grid/
302
+ Project Page - http://thisisdallas.github.com/Simple-Grid/
303
+ Author - Dallas Bass
304
+ Site - dallasbass.com
305
+ */
306
+
307
+ *, *:after, *:before {
308
+ -webkit-box-sizing: border-box;
309
+ -moz-box-sizing: border-box;
310
+ box-sizing: border-box;
311
+ }
312
+
313
+ body {
314
+ margin: 0px;
315
+ }
316
+
317
+ [class*='col-'] {
318
+ float: left;
319
+ padding-right: 20px;
320
+ }
321
+
322
+ [class*='col-']:last-of-type {
323
+ padding-right: 0px;
324
+ }
325
+
326
+ .grid {
327
+ width: 100%;
328
+
329
+ margin: 0 auto;
330
+ overflow: hidden;
331
+ }
332
+
333
+ .grid:after {
334
+ content: "";
335
+ display: table;
336
+ clear: both;
337
+ }
338
+
339
+ .grid-pad {
340
+ padding: 20px 0 0px 20px;
341
+ }
342
+
343
+ .grid-pad > [class*='col-']:last-of-type {
344
+ padding-right: 20px;
345
+ }
346
+
347
+ .push-right {
348
+ float: right;
349
+ }
350
+
351
+ /* Content Columns */
352
+
353
+ .col-1-1 {
354
+ width: 100%;
355
+ }
356
+ .col-2-3, .col-8-12 {
357
+ width: 66.66%;
358
+ }
359
+
360
+ .col-1-2, .col-6-12 {
361
+ width: 50%;
362
+ }
363
+
364
+ .col-1-3, .col-4-12 {
365
+ width: 33.33%;
366
+ }
367
+
368
+ .col-1-4, .col-3-12 {
369
+ width: 25%;
370
+ }
371
+
372
+ .col-1-5 {
373
+ width: 20%;
374
+ }
375
+
376
+ .col-1-6, .col-2-12 {
377
+ width: 16.667%;
378
+ }
379
+
380
+ .col-1-7 {
381
+ width: 14.28%;
382
+ }
383
+
384
+ .col-1-8 {
385
+ width: 12.5%;
386
+ }
387
+
388
+ .col-1-9 {
389
+ width: 11.1%;
390
+ }
391
+
392
+ .col-1-10 {
393
+ width: 10%;
394
+ }
395
+
396
+ .col-1-11 {
397
+ width: 9.09%;
398
+ }
399
+
400
+ .col-1-12 {
401
+ width: 8.33%
402
+ }
403
+
404
+ /* Layout Columns */
405
+
406
+ .col-11-12 {
407
+ width: 91.66%
408
+ }
409
+
410
+ .col-10-12 {
411
+ width: 83.333%;
412
+ }
413
+
414
+ .col-9-12 {
415
+ width: 75%;
416
+ }
417
+
418
+ .col-5-12 {
419
+ width: 41.66%;
420
+ }
421
+
422
+ .col-7-12 {
423
+ width: 58.33%
424
+ }
425
+
426
+ @media handheld, only screen and (max-width: 767px) {
427
+
428
+
429
+ .grid {
430
+ width: 100%;
431
+ min-width: 0;
432
+ margin-left: 0px;
433
+ margin-right: 0px;
434
+ padding-left: 0px;
435
+ padding-right: 0px;
436
+ }
437
+
438
+ [class*='col-'] {
439
+ width: auto;
440
+ float: none;
441
+ margin-left: 0px;
442
+ margin-right: 0px;
443
+ margin-top: 10px;
444
+ margin-bottom: 10px;
445
+ padding-right: 0px;
446
+ padding-left: 0px;
447
+ }
448
+ }
449
+
450
+ .noUi-connect {
451
+ box-shadow: none;
452
+ background: #5bc0de;
453
+ }
454
+
455
+ .noUi-handle {
456
+ box-shadow: none;
457
+ }
458
+
459
+ .noUi-target {
460
+ box-shadow: none;
461
+ border-color: #eee;
462
+ }
463
+
464
+ .noUi-background {
465
+ box-shadow: none;
466
+ background-color: #eee;
467
+ }
468
+
469
+ .noUi-origin {
470
+ border-radius: 0;
471
+ }
472
+
473
+ #periods {
474
+ text-align: center;
475
+ }
476
+
477
+ #periods a {
478
+ margin-right: 20px;
479
+ }
480
+
481
+ .chart {
482
+ height: 300px;
483
+ line-height: 300px;
484
+ text-align: center;
485
+ color: #999;
486
+ }
487
+
488
+ .unused-index {
489
+ color: #f0ad4e;
490
+ font-size: 11px;
491
+ font-weight: bold;
492
+ }
493
+
494
+ .primary-key {
495
+ color: #f0ad4e;
496
+ font-size: 11px;
497
+ font-weight: bold;
498
+ }
499
+
500
+ .origin {
501
+ word-break: break-word;
502
+ }
503
+
504
+ .duplicate-indexes td {
505
+ padding: 15px 0 5px 0;
506
+ }
507
+
508
+ .duplicate-indexes pre {
509
+ margin-top: 10px;
510
+ }
511
+
512
+ .no-outline:focus {
513
+ outline: none;
514
+ }