Skip to content

Commit

Permalink
UI: Fix Maximum call stack size exceeded error. Also fix units for re…
Browse files Browse the repository at this point in the history
…ndering latency.
  • Loading branch information
Pawan Rawal committed Jul 28, 2017
1 parent 59e8a58 commit 9e6dad3
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 16 deletions.
4 changes: 2 additions & 2 deletions dashboard/build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"main.css": "static/css/main.d6f0cfd3.css",
"main.css.map": "static/css/main.d6f0cfd3.css.map",
"main.js": "static/js/main.e0e4d27c.js",
"main.js.map": "static/js/main.e0e4d27c.js.map",
"main.js": "static/js/main.39476d03.js",
"main.js.map": "static/js/main.39476d03.js.map",
"static/media/addNodeIcon.png": "static/media/addNodeIcon.a1a2d01b.png",
"static/media/backIcon.png": "static/media/backIcon.dd0baa69.png",
"static/media/connectIcon.png": "static/media/connectIcon.d5267b8d.png",
Expand Down
2 changes: 1 addition & 1 deletion dashboard/build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="shortcut icon" href="/favicon.ico"><script>window.SERVER_URL=location.protocol+"//"+location.hostname+(location.port?":"+location.port:"")</script><script src="https://use.fontawesome.com/bd4789f5b8.js"></script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.25.2/theme/neo.css" integrity="sha256-qRnm2qfT/Q52+7DC2rgmj2+ZjTgb9s12gC6tuLb0tv0=" crossorigin="anonymous"/><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/styles/github.min.css" integrity="sha256-3YM6A3pH4QFCl9WbSU8oXF5N6W/2ylvW0o2g+Z6TmLQ=" crossorigin="anonymous"/><title>Dgraph Browser</title><script>!function(e,t,r,n,a){if(!e[a]){for(var i=e[a]=[],s=0;s<r.length;s++){var c=r[s];i[c]=i[c]||function(e){return function(){var t=Array.prototype.slice.call(arguments);i.push([e,t])}}(c)}i.SNIPPET_VERSION="1.0.1";var o=t.createElement("script");o.type="text/javascript",o.async=!0,o.src="https://d2yyd1h5u9mauk.cloudfront.net/integrations/web/v1/library/NKLggFBPuCtnmits/"+a+".js";var u=t.getElementsByTagName("script")[0];u.parentNode.insertBefore(o,u)}}(window,document,["survey","reset","config","init","set","get","event","identify","track","page","screen","group","alias"],0,"delighted")</script><link href="/static/css/main.d6f0cfd3.css" rel="stylesheet"></head><body><div id="root"></div><script>!function(){var e,t,r=document,c=r.getElementById,m=r.createElement,a=r.getElementsByTagName,l="typef_orm_share";c.call(r,l)||(e=m.call(r,"script"),e.id=l,e.src="https://embed.typeform.com/embed.js",t=a.call(r,"script")[0],t.parentNode.insertBefore(e,t))}()</script><script type="text/javascript" src="/static/js/main.e0e4d27c.js"></script></body></html>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="shortcut icon" href="/favicon.ico"><script>window.SERVER_URL=location.protocol+"//"+location.hostname+(location.port?":"+location.port:"")</script><script src="https://use.fontawesome.com/bd4789f5b8.js"></script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.25.2/theme/neo.css" integrity="sha256-qRnm2qfT/Q52+7DC2rgmj2+ZjTgb9s12gC6tuLb0tv0=" crossorigin="anonymous"/><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/styles/github.min.css" integrity="sha256-3YM6A3pH4QFCl9WbSU8oXF5N6W/2ylvW0o2g+Z6TmLQ=" crossorigin="anonymous"/><title>Dgraph Browser</title><script>!function(e,t,r,n,a){if(!e[a]){for(var i=e[a]=[],s=0;s<r.length;s++){var c=r[s];i[c]=i[c]||function(e){return function(){var t=Array.prototype.slice.call(arguments);i.push([e,t])}}(c)}i.SNIPPET_VERSION="1.0.1";var o=t.createElement("script");o.type="text/javascript",o.async=!0,o.src="https://d2yyd1h5u9mauk.cloudfront.net/integrations/web/v1/library/NKLggFBPuCtnmits/"+a+".js";var u=t.getElementsByTagName("script")[0];u.parentNode.insertBefore(o,u)}}(window,document,["survey","reset","config","init","set","get","event","identify","track","page","screen","group","alias"],0,"delighted")</script><link href="/static/css/main.d6f0cfd3.css" rel="stylesheet"></head><body><div id="root"></div><script>!function(){var e,t,r=document,c=r.getElementById,m=r.createElement,a=r.getElementsByTagName,l="typef_orm_share";c.call(r,l)||(e=m.call(r,"script"),e.id=l,e.src="https://embed.typeform.com/embed.js",t=a.call(r,"script")[0],t.parentNode.insertBefore(e,t))}()</script><script type="text/javascript" src="/static/js/main.39476d03.js"></script></body></html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions dashboard/src/components/SessionFooterResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ const SessionFooterResult = ({
</div>
<div className="col-12 col-sm-4">
<div className="latency stats">
{session.response.data.data.server_latency
{session.response.data.data &&
session.response.data.data.server_latency
? <div className="stat">
Server latency:
{" "}
Expand All @@ -57,7 +58,9 @@ const SessionFooterResult = ({
? <div className="stat">
Rendering latency:
{" "}
<span className="value">{humanizeTime(treeRenderTime)}</span>
<span className="value">
{humanizeTime(treeRenderTime)}
</span>
</div>
: null}
</div>
Expand Down
6 changes: 5 additions & 1 deletion dashboard/src/lib/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,11 @@ export function processGraph(
// Or if the count of children at root which don't have children is > than those
// which have children we show them.
if (!someNodeHasChildren || ignoredChildren.length > nodesQueue.length) {
nodesQueue.push.apply(nodesQueue, ignoredChildren);
// Push one by one else we get Maximum call stack size exceeded error.
// https://stackoverflow.com/questions/22123769/rangeerror-maximum-call-stack-size-exceeded-why
for (var i = 0; i < ignoredChildren.length; i++) {
nodesQueue.push(ignoredChildren[i]);
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion dashboard/src/lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ export function eraseCookie(name, options) {

export function humanizeTime(time) {
if (time > 1000) {
return time.toFixed(1) + "s";
// Time is in ms, lets convert it to seconds for displaying.
return (time / 1000).toFixed(1) + "s";
}
return time.toFixed(0) + "ms";
}
Expand Down

0 comments on commit 9e6dad3

Please sign in to comment.