Permalink
Browse files

Move measuring subsystem to subdirectory.

  • Loading branch information...
1 parent 06e1d74 commit b3dec4297792acb68cf8dfa3a7a4806ca392fbaa @kpreid committed Sep 8, 2012
View
@@ -8,6 +8,7 @@
<title>Cubes</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width">
+ <link rel="stylesheet" href="deps/measuring/src/measuring.css" type="text/css">
<link rel="stylesheet" href="style.css" type="text/css">
<!-- Third-party GL libraries -->
@@ -21,7 +22,7 @@
<!-- Framework -->
<script type="text/javascript" src="util.js"></script>
<script type="text/javascript" src="storage.js"></script>
- <script type="text/javascript" src="measuring.js"></script>
+ <script type="text/javascript" src="deps/measuring/src/measuring.js"></script>
<!-- Game components -->
<script type="text/javascript" src="measuring-instance.js"></script>
@@ -0,0 +1,59 @@
+.measuring-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;
+}
+.measuring-item .measuring-item {
+ /* non-roots */
+ padding: 0;
+ background: none;
+}
+.measuring-label, .measuring-group-header {
+ display: inline-block;
+ min-width: 16ex;
+ text-align: left;
+}
+.measuring-value {
+ display: inline-block;
+ min-width: 13ex;
+ text-align: right;
+}
+.measuring-group-header {
+ background: none;
+ color: #CCC;
+ font-weight: bold;
+}
+ul.measuring-group-contents, ol.measuring-group-contents {
+ margin: 0 0 0 0;
+ padding: 0 0 0 1em;
+ list-style-type: none;
+}
+.measuring-sparkline {
+ vertical-align: baseline;
+}
+.measuring-hide-sparklines .measuring-sparkline {
+ display: none;
+}
+.measuring-toggle {
+ /* reset <button> style */
+ margin: 0;
+ border: none;
+ padding: 0;
+ color: inherit;
+ background: none;
+ font: inherit;
+
+ /* specific style */
+ font-weight: bold;
+
+ pointer-events: auto;
+}
@@ -250,28 +250,10 @@
}
TaskGroup.prototype = Object.create(ViewGroup.prototype);
- 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")
- ])
- ]);
-
- // Object.freeze(measuring);
+ cubes.Measuring = Object.freeze({
+ Counter: Counter,
+ TaskGroup: TaskGroup,
+ TopGroup: TopGroup,
+ ViewGroup: ViewGroup
+ });
}());
View
@@ -472,65 +472,3 @@ body {
color: black;
background: white;
}
-
-/* --- performance measurement widgets --- */
-
-.measuring-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;
-}
-.measuring-item .measuring-item {
- /* non-roots */
- padding: 0;
- background: none;
-}
-.measuring-label, .measuring-group-header {
- display: inline-block;
- min-width: 16ex;
- text-align: left;
-}
-.measuring-value {
- display: inline-block;
- min-width: 13ex;
- text-align: right;
-}
-.measuring-group-header {
- background: none;
- color: #CCC;
- font-weight: bold;
-}
-ul.measuring-group-contents, ol.measuring-group-contents {
- margin: 0 0 0 0;
- padding: 0 0 0 1em;
- list-style-type: none;
-}
-.measuring-sparkline {
- vertical-align: baseline;
-}
-.measuring-hide-sparklines .measuring-sparkline {
- display: none;
-}
-.measuring-toggle {
- /* reset <button> style */
- margin: 0;
- border: none;
- padding: 0;
- color: inherit;
- background: none;
- font: inherit;
-
- /* specific style */
- font-weight: bold;
-
- pointer-events: auto;
-}
View
@@ -29,7 +29,7 @@
<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="../measuring.js"></script>
+ <script type="text/javascript" src="../deps/measuring/src/measuring.js"></script>
<script type="text/javascript" src="../measuring-instance.js"></script>
<script type="text/javascript" src="../circuit.js"></script>
<script type="text/javascript" src="../blockset.js"></script>

0 comments on commit b3dec42

Please sign in to comment.