forked from mathieuancelin/js-repaint-perfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.compiled.js
84 lines (84 loc) · 3.91 KB
/
app.compiled.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
!function() {
"use strict";
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
var _preact = preact, h = _preact.h, Component = _preact.Component, render = _preact.render, Query = function(_Component) {
function Query() {
_Component.apply(this, arguments);
}
return _inherits(Query, _Component), Query.prototype.shouldComponentUpdate = function(_ref) {
var query = _ref.query, elapsed = _ref.elapsed;
return query !== this.props.query || elapsed !== this.props.elapsed;
}, Query.prototype.render = function(_ref2) {
var query = _ref2.query, formatElapsed = (_ref2.elapsed, _ref2.formatElapsed), elapsedClassName = _ref2.elapsedClassName;
return h("td", {
"class": "Query " + elapsedClassName
}, formatElapsed || " ", h("div", {
"class": "popover left"
}, h("div", {
"class": "popover-content"
}, query), h("div", {
"class": "arrow"
})));
}, Query;
}(Component), Database = function(_Component2) {
function Database() {
_Component2.apply(this, arguments);
}
return _inherits(Database, _Component2), Database.prototype.shouldComponentUpdate = function(_ref3) {
var lastMutationId = _ref3.lastMutationId;
return lastMutationId !== this.props.lastMutationId;
}, Database.prototype.renderQuery = function(query) {
return h(Query, {
query: query.query,
elapsed: query.elapsed,
formatElapsed: query.formatElapsed,
elapsedClassName: query.elapsedClassName
});
}, Database.prototype.render = function(_ref4) {
var lastSample = _ref4.lastSample, dbname = _ref4.dbname;
return h("tr", null, h("td", {
"class": "dbname"
}, dbname), h("td", {
"class": "query-count"
}, h("span", {
"class": lastSample.countClassName
}, lastSample.nbQueries)), lastSample.topFiveQueries.map(this.renderQuery));
}, Database;
}(Component), DBMon = function(_Component3) {
function DBMon() {
_Component3.apply(this, arguments), this.state = {
databases: []
};
}
return _inherits(DBMon, _Component3), DBMon.prototype.loadSamples = function() {
this.setState({
databases: ENV.generateData(!0).toArray()
}), Monitoring.renderRate.ping(), setTimeout(this.loadSamples.bind(this), ENV.timeout);
}, DBMon.prototype.componentDidMount = function() {
this.loadSamples();
}, DBMon.prototype.renderDatabase = function(database) {
return h(Database, {
lastMutationId: database.lastMutationId,
dbname: database.dbname,
samples: database.samples,
lastSample: database.lastSample
});
}, DBMon.prototype.render = function(_ref5, _ref6) {
var databases = _ref6.databases;
return h("div", null, h("table", {
"class": "table table-striped latest-data"
}, h("tbody", null, databases.map(this.renderDatabase))));
}, DBMon;
}(Component);
render(h(DBMon, null), document.getElementById("dbmon"));
}();