diff --git a/index.html b/index.html index 165aafd0..2dc3cc60 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@
-0.27.6
0.27.7
peerStore
Connection
will be sent in the callback
Connection
will be sent in the callback
Connection
will be sent in the callback
Connection
will be sent in the callback
PeerStore
.
-
+
src/get-peer-info.js
@@ -3466,7 +3544,7 @@ the libp2p
PeerRouter will be used to attempt to find the peer.
-
+
src/connection-manager/index.js
@@ -3637,7 +3715,7 @@ the libp2p
PeerRouter will be used to attempt to find the peer.
-
+
src/connection-manager/index.js
@@ -3692,7 +3770,7 @@ only event loop and connection limits will be monitored.
-
+
src/connection-manager/index.js
@@ -3746,7 +3824,7 @@ only event loop and connection limits will be monitored.
-
+
src/connection-manager/index.js
@@ -3823,7 +3901,7 @@ will be disconnected first.
-
+
src/connection-manager/index.js
@@ -3890,7 +3968,7 @@ will be disconnected first.
-
+
src/connection-manager/index.js
@@ -3942,6 +4020,599 @@ will be disconnected first.
+
+
+
+
+
+ This code is based on latency-monitor
(https://github.com/mlucool/latency-monitor) by mlucool
(https://github.com/mlucool), available under Apache License 2.0 (https://github.com/mlucool/latency-monitor/blob/master/LICENSE)
+ Type: + Object +
+ + + + + + + + + + + + + +(Number)
+ : How many events were called
+
+
+ (Number)
+ : What was the min time for a cb to be called
+
+
+ (Number)
+ : What was the max time for a cb to be called
+
+
+ (Number)
+ : What was the average time for a cb to be called
+
+
+ (Number)
+ : How long this interval was in ms
+
+
+ A class to monitor latency of any async function which works in a browser or node. This works by periodically calling +the asyncTestFn and timing how long it takes the callback to be called. It can also periodically emit stats about this. +This can be disabled and stats can be pulled via setting dataEmitIntervalMs = 0.
+The default implementation is an event loop latency monitor. This works by firing periodic events into the event loop +and timing how long it takes to get back.
+ ++ Extends + + EventEmitter + +
+ + + + + + + + + + +(Object
+ = {}
)
+
+ Name | +Description | +
---|---|
$0.latencyCheckIntervalMs any
+ |
+ + |
$0.dataEmitIntervalMs any
+ |
+ + |
$0.asyncTestFn any
+ |
+ + |
$0.latencyRandomPercentage any
+ |
+ + |
(Number
+ = 500
)
+ How often to add a latency check event (ms)
+
+ (Number
+ = 5000
)
+ How often to summarize latency check events. null or 0 disables event firing
+
+ (function?)
+ What cb-style async function to use
+
+ (Number
+ = 5
)
+ What percent (+/-) of latencyCheckIntervalMs should we randomly use? This helps avoid alignment to other events.
+
+ const monitor = new LatencyMonitor();
+monitor.on('data', (summary) => console.log('Event Loop Latency: %O', summary));
+
+
+ const monitor = new LatencyMonitor({latencyCheckIntervalMs: 1000, dataEmitIntervalMs: 60000, asyncTestFn:ping});
+monitor.on('data', (summary) => console.log('Ping Pong Latency: %O', summary));
+
+
+
+
+
+
+ Calling this function will end the collection period. If a timing event was already fired and somewhere in the queue, +it will not count for this time period
+ +SummaryObject
:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+This code is based on latency-monitor
(https://github.com/mlucool/latency-monitor) by mlucool
(https://github.com/mlucool), available under Apache License 2.0 (https://github.com/mlucool/latency-monitor/blob/master/LICENSE)
Listen to page visibility change events (i.e. when the page is focused / blurred) by an event emitter.
+Warning: This does not work on all browsers, but should work on all modern browsers
+ +const myVisibilityEmitter = new VisibilityChangeEmitter();
+
+ myVisibilityEmitter.on('visibilityChange', (pageInFocus) => {
+ if ( pageInFocus ){
+ // Page is in focus
+ console.log('In focus');
+ }
+ else {
+ // Page is blurred
+ console.log('Out of focus');
+ }
+ });
+ // To access the visibility state directly, call:
+ console.log('Am I focused now? ' + myVisibilityEmitter.isVisible());
+
+
+
+
+
+
+
+
+
+
+The function returns true
if the page is visible or false
if the page is not visible and
+undefined
if the page visibility API is not supported by the browser.
(Boolean | void)
:
+ whether the page is now visible or not (undefined is unknown)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
stop
is called, start
must be called to resume st
-
+
src/metrics/index.js
@@ -6482,7 +7153,7 @@ Once stop
is called, start
must be called to resume st
-
+
src/metrics/index.js
@@ -6544,7 +7215,7 @@ Once stop
is called, start
must be called to resume st
-
+
src/metrics/index.js
@@ -6620,7 +7291,7 @@ is a live peer, or in the disconnected peer LRU cache.
-
+
src/metrics/index.js
@@ -6682,7 +7353,7 @@ is a live peer, or in the disconnected peer LRU cache.
-
+
src/metrics/index.js
@@ -6757,7 +7428,7 @@ is a live peer, or in the disconnected peer LRU cache.
-
+
src/metrics/index.js
@@ -6826,7 +7497,7 @@ be stopped and moved to an LRU for temporary retention.
-
+
src/metrics/index.js
@@ -6904,7 +7575,7 @@ placeholder stats will be merged with the existing stats.
-
+
src/metrics/index.js
@@ -7034,7 +7705,7 @@ with the placeholder string returned from here, and the known PeerId
-
+
src/metrics/index.js
@@ -7118,7 +7789,7 @@ and returned.
-
+
src/metrics/old-peers.js
@@ -7193,7 +7864,7 @@ and returned.
-
+
src/metrics/stats.js
@@ -7273,7 +7944,7 @@ and returned.
Stats.stop
was previously called,
PeerId
of the peer.
-
+
src/registrar.js
@@ -9979,7 +10650,7 @@ will include the encapsulated PeerId
of the peer.
multiaddrs
-
+
src/identify/index.js
@@ -11512,7 +12183,7 @@ with the provided protocols
-
+
src/identify/index.js