Permalink
Browse files

Replace local copy of Measviz with submodule.

  • Loading branch information...
1 parent 4938b1c commit aad9e63205bcab0700b3183bc6a10b9e521b1b45 @kpreid committed Sep 10, 2012
Showing with 4 additions and 469 deletions.
  1. +3 −0 .gitmodules
  2. +1 −0 deps/measviz
  3. +0 −122 deps/measviz/demo/testbed.html
  4. +0 −59 deps/measviz/src/measviz.css
  5. +0 −288 deps/measviz/src/measviz.js
View
@@ -10,3 +10,6 @@
[submodule "deps/jshint"]
path = deps/jshint
url = git://github.com/jshint/jshint.git
+[submodule "deps/measviz"]
+ path = deps/measviz
+ url = git://github.com/kpreid/measviz.git
Submodule measviz added at 182f0e
@@ -1,122 +0,0 @@
-<!doctype html>
-<!--
- Except as noted,
- Copyright 2011-2012 Kevin Reid under the terms of the MIT License as detailed
- in the accompanying file README.md or <http://opensource.org/licenses/MIT>.
--->
-<html><head>
- <title>Cubes Measuring Testbed</title>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8">
- <meta name="viewport" content="width=device-width">
- <link rel="stylesheet" href="../src/measviz.css" type="text/css">
-
- <script type="text/javascript" src="../../../deps/gl-matrix/gl-matrix.js"></script>
- <script type="text/javascript" src="../../../deps/game-shim/game-shim.js"></script>
- <script type="text/javascript" src="../../../module-initial.js"></script>
- <script type="text/javascript" src="../../../util.js"></script>
- <script type="text/javascript" src="../../../storage.js"></script>
- <script type="text/javascript" src="../src/measviz.js"></script>
-</head>
-<body>
-
-<script type="text/javascript">
-
- var TopGroup = measviz.TopGroup;
- var ViewGroup = measviz.ViewGroup;
- var TaskGroup = measviz.TaskGroup;
- var Counter = measviz.Counter;
-
- // TODO: Make up a demo-relevant example
- var measuring = {};
- measuring.all = new TopGroup("Performance", [
- measuring.second = new ViewGroup("Per second", [
- measuring.simCount = new Counter("Steps"),
- measuring.frameCount = new Counter("Frames"),
- measuring.chunkCount = new Counter("Chunk calcs"),
- measuring.lightUpdateCount = new Counter("Light updates")
- ]),
- measuring.sim = new TaskGroup("Simulation", [
- measuring.collisionTests = new Counter("Collision tests"),
- measuring.blockEvals = new Counter("Block evals")
- ]),
- measuring.chunk = new TaskGroup("Chunk calc", []),
- measuring.frame = new TaskGroup("Frame", [
- measuring.bundles = new Counter("Bundles"),
- measuring.vertices = new Counter("Vertices")
- ]),
- measuring.queues = new ViewGroup("Queue sizes", [
- measuring.chunkQueueSize = new Counter("Chunks"),
- measuring.lightingQueueSize = new Counter("Lights"),
- measuring.persistenceQueueSize = new Counter("Dirty objs")
- ])
- ]);
-
-
- // Fast callbacks
- // Source: http://dbaron.org/log/20100309-faster-timeouts
- (function() {
- var timeouts = [];
- var messageName = "zero-timeout-message";
-
- // Like setTimeout, but only takes a function argument. There's
- // no time argument (always zero) and no arguments (you have to
- // use a closure).
- function setZeroTimeout(fn) {
- timeouts.push(fn);
- window.postMessage(messageName, "*");
- }
-
- function handleMessage(event) {
- if (event.source == window && event.data == messageName) {
- event.stopPropagation();
- if (timeouts.length > 0) {
- var fn = timeouts.shift();
- fn();
- }
- }
- }
-
- window.addEventListener("message", handleMessage, true);
-
- // Add the one thing we want added to the window object.
- window.setZeroTimeout = setZeroTimeout;
- })();
-
-
- var measureDisplay = measuring.all.createDisplay(document, "cubes.measurement-ui");
-
- document.body.appendChild(measureDisplay.element);
-
- measuring.second.start();
- setInterval(function () {
- measuring.second.end();
- measuring.second.start();
- if (measureDisplay) measureDisplay.updateIfVisible();
- }, 1000);
-
- function loop() {
- measuring.frameCount.inc(); // count overall performance
-
- // fake some data
- measuring.frame.start();
- measuring.bundles.inc(Math.floor((Math.sin(Date.now()) + 1) * 1000));
-
- // update everything
- measuring.sim.start();
- measuring.sim.end();
- measuring.chunk.start();
- measuring.chunk.end();
- measuring.queues.start();
- measuring.queues.end();
-
- measureDisplay.updateIfVisible();
- setZeroTimeout(loop);
-
- measuring.frame.end();
- }
- setZeroTimeout(loop);
-</script>
-
-<p>This file is designed to test the performance of Measviz, to ensure it does not place excessive load on that which it measures.</p>
-
-</body></html>
@@ -1,59 +0,0 @@
-.measviz-item {
- display: table;
- font-family: "Geneva", "Verdana", sans-serif;
- font-size: 9px;
- color: white;
- white-space: nowrap; /* work around spurious wrap in ~ Chrome 22.0.1207.1 dev */
-
- pointer-events: none;
-
- /* root-only styles */
- background: black;
- background: rgba(80,80,80,0.5);
- padding: 3px;
-}
-.measviz-item .measviz-item {
- /* non-roots */
- padding: 0;
- background: none;
-}
-.measviz-label, .measviz-group-header {
- display: inline-block;
- min-width: 16ex;
- text-align: left;
-}
-.measviz-value {
- display: inline-block;
- min-width: 13ex;
- text-align: right;
-}
-.measviz-group-header {
- background: none;
- color: #CCC;
- font-weight: bold;
-}
-ul.measviz-group-contents, ol.measviz-group-contents {
- margin: 0 0 0 0;
- padding: 0 0 0 1em;
- list-style-type: none;
-}
-.measviz-sparkline {
- vertical-align: baseline;
-}
-.measviz-hide-sparklines .measviz-sparkline {
- display: none;
-}
-.measviz-toggle {
- /* reset <button> style */
- margin: 0;
- border: none;
- padding: 0;
- color: inherit;
- background: none;
- font: inherit;
-
- /* specific style */
- font-weight: bold;
-
- pointer-events: auto;
-}
Oops, something went wrong.

0 comments on commit aad9e63

Please sign in to comment.