Browse Source

update gundb to 0.2020.514

Nikolay Suslov 4 years ago
parent
commit
f3b883864e
4 changed files with 68 additions and 35 deletions
  1. 1 1
      index.html
  2. 43 26
      package-lock.json
  3. 1 1
      package.json
  4. 23 7
      stats/stats.html

+ 1 - 1
index.html

@@ -1 +1 @@
-<span> GunDB version: 0.2020.430 </span>
+<span> GunDB version: 0.2020.514 </span>

+ 43 - 26
package-lock.json

@@ -5,12 +5,14 @@
   "requires": true,
   "dependencies": {
     "@peculiar/asn1-schema": {
-      "version": "1.1.2",
-      "resolved": "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-1.1.2.tgz",
-      "integrity": "sha512-ntQ4UnUFgdjs0tfWR6YmEQm/x0glV4OFus/RjxLkaJUKfu/R7VilefBntyUO3MoKWdlCgib30KN+JpCY1HqU2A==",
+      "version": "2.0.3",
+      "resolved": "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-2.0.3.tgz",
+      "integrity": "sha512-STqC+Tfx2dTiIGRmokjsKOeqsfhoV6WaBwFr7BVicSfHLAVSPrZXiugyD8AELrjQdJ9INWpL3N7YSJyU5a1ZwA==",
       "optional": true,
       "requires": {
+        "@types/asn1js": "^0.0.1",
         "asn1js": "^2.0.26",
+        "pvtsutils": "^1.0.10",
         "tslib": "^1.11.1"
       }
     },
@@ -24,16 +26,25 @@
       }
     },
     "@peculiar/webcrypto": {
-      "version": "1.0.29",
-      "resolved": "https://registry.npmjs.org/@peculiar/webcrypto/-/webcrypto-1.0.29.tgz",
-      "integrity": "sha512-3e6CIpjZuj5WxPymGm0kCZA05XA9BSXwBEb/mU9KjBHAmEwMokT0yVIhxqwspCHSynlrTfUB+9KTNpseyB077A==",
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/@peculiar/webcrypto/-/webcrypto-1.1.1.tgz",
+      "integrity": "sha512-Bu2XgOvzirnLcojZYs4KQ8hOLf2ETpa0NL6btQt5NgsAwctI6yVkzgYP+EcG7Mm579RBP+V0LM5rXyMlTVx23A==",
       "optional": true,
       "requires": {
-        "@peculiar/asn1-schema": "^1.1.2",
+        "@peculiar/asn1-schema": "^2.0.3",
         "@peculiar/json-schema": "^1.1.10",
         "pvtsutils": "^1.0.10",
-        "tslib": "^1.11.1",
-        "webcrypto-core": "^1.0.20"
+        "tslib": "^1.11.2",
+        "webcrypto-core": "^1.1.0"
+      }
+    },
+    "@types/asn1js": {
+      "version": "0.0.1",
+      "resolved": "https://registry.npmjs.org/@types/asn1js/-/asn1js-0.0.1.tgz",
+      "integrity": "sha1-74uflwjLFjKhw6nNJ3F8qr55O8I=",
+      "optional": true,
+      "requires": {
+        "@types/pvutils": "*"
       }
     },
     "@types/color-name": {
@@ -41,10 +52,16 @@
       "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",
       "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ=="
     },
+    "@types/pvutils": {
+      "version": "0.0.2",
+      "resolved": "https://registry.npmjs.org/@types/pvutils/-/pvutils-0.0.2.tgz",
+      "integrity": "sha512-CgQAm7pjyeF3Gnv78ty4RBVIfluB+Td+2DR8iPaU0prF18pkzptHHP+DoKPfpsJYknKsVZyVsJEu5AuGgAqQ5w==",
+      "optional": true
+    },
     "@unimodules/core": {
-      "version": "5.1.0",
-      "resolved": "https://registry.npmjs.org/@unimodules/core/-/core-5.1.0.tgz",
-      "integrity": "sha512-gaamGkJ4PVwusWEfsZyPo4uhrVWPDE0BmHc/lTYfkZCv2oIAswC7gG/ULRdtZpYdwnYqFIZng+WQxwuVrJUNDw==",
+      "version": "5.1.2",
+      "resolved": "https://registry.npmjs.org/@unimodules/core/-/core-5.1.2.tgz",
+      "integrity": "sha512-iCWEbzsNHqDfL6p8FyCGPnL2EW7vdgMJsNNSlWtM/gl8kePdqZMI7aOxTC4cdRS2xm0wzxuDBtpfJkzZsKINZg==",
       "optional": true,
       "requires": {
         "compare-versions": "^3.4.0"
@@ -238,9 +255,9 @@
       "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="
     },
     "gun": {
-      "version": "0.2020.430",
-      "resolved": "https://registry.npmjs.org/gun/-/gun-0.2020.430.tgz",
-      "integrity": "sha512-mCRrz/VUflCGaRVOA4pTnRo5YSP5pa0lpSszqQ6offJQC9PzClvl2aofpaaHOXx5rFzw34HP/EjWZP3cxen3gQ==",
+      "version": "0.2020.514",
+      "resolved": "https://registry.npmjs.org/gun/-/gun-0.2020.514.tgz",
+      "integrity": "sha512-gKOUJUenNhVFmWOij7RjuXsluY8dSsFjX2mOA5MXrfvZP4Lqv6pEpSntnQmDmo3PHfECOaPF955JLLpiLVuLbw==",
       "requires": {
         "buffer": "^5.4.3",
         "bufferutil": "^4.0.1",
@@ -455,9 +472,9 @@
       "optional": true
     },
     "tslib": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz",
-      "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==",
+      "version": "1.13.0",
+      "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz",
+      "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==",
       "optional": true
     },
     "utf-8-validate": {
@@ -470,16 +487,16 @@
       }
     },
     "webcrypto-core": {
-      "version": "1.0.21",
-      "resolved": "https://registry.npmjs.org/webcrypto-core/-/webcrypto-core-1.0.21.tgz",
-      "integrity": "sha512-PcSD8Ga3u344LXEcI/1UbGv3dv5rZ8pzkeJIrMf/JOnEq8H5hSMmdTrRIp2WFYYnMNdKQbP564v560ZmERT2HQ==",
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/webcrypto-core/-/webcrypto-core-1.1.1.tgz",
+      "integrity": "sha512-xK61sFRUyZdSAJG7+bJox36+Tnhxw1PaMbmrLLp30HNTJ4mffqsY2jUMlmGq6OOoej3WO/SsH5serzlzBMZ+jg==",
       "optional": true,
       "requires": {
-        "@peculiar/asn1-schema": "^1.1.2",
+        "@peculiar/asn1-schema": "^2.0.1",
         "@peculiar/json-schema": "^1.1.10",
         "asn1js": "^2.0.26",
         "pvtsutils": "^1.0.10",
-        "tslib": "^1.11.1"
+        "tslib": "^1.11.2"
       }
     },
     "webcrypto-shim": {
@@ -504,9 +521,9 @@
       }
     },
     "ws": {
-      "version": "7.2.5",
-      "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.5.tgz",
-      "integrity": "sha512-C34cIU4+DB2vMyAbmEKossWq2ZQDr6QEyuuCzWrM9zfw1sGc0mYiJ0UnG9zzNykt49C2Fi34hvr2vssFQRS6EA=="
+      "version": "7.3.0",
+      "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.0.tgz",
+      "integrity": "sha512-iFtXzngZVXPGgpTlP1rBqsUK82p9tKqsWRPg5L56egiljujJT3vGAYnHANvFxBieXrTFavhzhxW52jnaWV+w2w=="
     },
     "y18n": {
       "version": "4.0.0",

+ 1 - 1
package.json

@@ -16,7 +16,7 @@
   "author": "Nikolay Suslov",
   "license": "MIT",
   "dependencies": {
-    "gun": "0.2020.430",
+    "gun": "0.2020.514",
     "yargs": "15.3.1"
   }
 }

+ 23 - 7
stats/stats.html

@@ -29,7 +29,7 @@
   .tall { height: 5em; }
 </style>
 
-<div class="center"><span class="shout" id="peers">0</span> peers <span class="shout" id="time">0</span> min <span class="shout" id="nodes">0</span> nodes <span class="shout" id="hours">0</span> hours</div>
+<div class="center"><span class="shout" id="peers">0</span> peers <span class="shout" id="time">0</span> min <span class="shout" id="nodes">0</span> nodes <span class="shout" id="hours">0</span> hours <span class="shout" id="block">0</span> block</div>
 
 <input id="url" class="center input crack" placeholder="enter peer stats source url">
 
@@ -44,19 +44,24 @@
 <script src="./jquery.js"></script>
 <script src="./smoothie.js" charset="utf-8"></script>
 <script>
+  var up, br = 0, bt = 0;
   var fetchData = async function(){
     // fetch the data from server
+    var S = +new Date;
     var data = await (await fetch(url.value||(location.origin+'/gun/stats.radata'), {method: 'GET',mode: 'cors'})).json();
+    $('#block').text(((br += (+new Date - S)/1000) / ++bt).toFixed(1));
+    data.over = (data.over/1000) || 15;
 		$('#peers').text(data.peers.count);
 		$('#time').text((data.peers.time / 1000 / 60).toFixed(0));
 		$('#nodes').text(data.node.count);
-		$('#hours').text((data.up.time / 60 / 60).toFixed(0));
+		$('#hours').text((data.up.time / 60 / 60).toFixed(1));
+    if(data.up.time === up){ console.log("up same as before") } up = data.up.time;
 
 		Stats('memory').line.append(+new Date, data.memory.heapTotal / 1024 / 1024);
-    try{ Stats('dam # in').line.append(+new Date, data.dam.in.count); }catch(e){}
-    try{ Stats('dam in MB').line.append(+new Date, data.dam.in.done / 1024 / 1024); }catch(e){}
-    try{ Stats('dam # out').line.append(+new Date, data.dam.out.count); }catch(e){}
-    try{ Stats('dam out MB').line.append(+new Date, data.dam.out.done / 1024 / 1024); }catch(e){}
+    try{ Stats('dam # in/s').line.append(+new Date, Math.round(data.dam.in.count / data.over)); }catch(e){}
+    try{ Stats('dam in MB/s').line.append(+new Date, data.dam.in.done / 1024 / 1024 / data.over); }catch(e){}
+    try{ Stats('dam # out/s').line.append(+new Date, Math.round(data.dam.out.count / data.over)); }catch(e){}
+    try{ Stats('dam out MB/s').line.append(+new Date, data.dam.out.done / 1024 / 1024 / data.over); }catch(e){}
 
     console.log('data',data);
     //fetch keys in all, these may be dynamically changing
@@ -83,16 +88,27 @@
   	}
 		// create a new Series for this key
 		// add it into the map
-		chart = Stats[key] = new SmoothieChart({responsive: true, minValue: 0, grid:{strokeStyle:'rgba(100%,100%,100%,0.2)'},labels:{fontSize:20}});
+		chart = Stats[key] = new SmoothieChart({millisPerPixel:500, limitFPS: 16, responsive: true, minValue: 0, grid:{strokeStyle:'rgba(100%,100%,100%,0.2)'},labels:{fontSize:20}, grid: {verticalSections: 0, millisPerLine: 15000 * 4 /*, strokeStyle:'rgb(125, 0, 0)'*/}});
 		chart.line = new TimeSeries();
 		chart.addTimeSeries(chart.line,{ strokeStyle:'rgb('+Math.random()*255+', '+Math.random()*255+','+Math.random()*255+')', lineWidth:5 });
 		chart.canvas = $('.model').find('.chart').clone(true).appendTo('.charts');
 		chart.canvas.find('span').text(key);
 		chart.streamTo(chart.canvas.find('canvas').get(0), 15 * 1000);
+    chart.line.append(0, 0);
 		// check first two characters of key to determine other charts to add this in
 		// tbd later
 		return chart;
   }
+/*
+  Notes to Self about Debugging:
+  1. Read Disks can spike up to 1min, I suspect other operations are blocking it from resolving as fast as it otherwise would.
+  2. JSON parsing/stringifying sometimes way slower than other times, why?
+  3. Looks like RAD lex read is not optimized.
+  4. got prep + got emit = non-RAD problems, compare against read disk & got differentials (should be same).
+  5. Radix map/place ops could be slow?
+  6. SINGLE MESSAGE PROCESS TIME occasionally is huge, should get emailed.
+  7. Watch out for get/put loops times, maybe indicating (5) issues?
+*/
 </script>
 </body>
 </html>