@sprucelabs/log
Advanced tools
Comparing version 1.3.1 to 1.4.0
@@ -6,2 +6,3 @@ // | ||
const SocketAdapter = require('../adapters/Sockets'); | ||
const getTimes = require('../collectors/browser'); | ||
@@ -107,2 +108,18 @@ const CLIENT = typeof window !== 'undefined'; | ||
collectBrowserMetrics() { | ||
if (typeof window !== 'undefined') { | ||
const stats = getTimes(); | ||
this.metric({ | ||
type: 'browserPageLoadStats', | ||
event: 'browserPageLoadStats', | ||
path: window.location.pathname, | ||
...stats | ||
}); | ||
} | ||
} | ||
times() { | ||
return getTimes(); | ||
} | ||
getAdapter() { | ||
@@ -109,0 +126,0 @@ return new HttpAdapter({ |
@@ -9,6 +9,6 @@ "use strict"; | ||
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); | ||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread")); | ||
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
@@ -34,2 +34,4 @@ | ||
var getTimes = require('../collectors/browser'); | ||
var CLIENT = typeof window !== 'undefined'; | ||
@@ -131,2 +133,19 @@ var os; | ||
}, { | ||
key: "collectBrowserMetrics", | ||
value: function collectBrowserMetrics() { | ||
if (typeof window !== 'undefined') { | ||
var stats = getTimes(); | ||
this.metric((0, _objectSpread2.default)({ | ||
type: 'browserPageLoadStats', | ||
event: 'browserPageLoadStats', | ||
path: window.location.pathname | ||
}, stats)); | ||
} | ||
} | ||
}, { | ||
key: "times", | ||
value: function times() { | ||
return getTimes(); | ||
} | ||
}, { | ||
key: "getAdapter", | ||
@@ -133,0 +152,0 @@ value: function getAdapter() { |
@@ -0,1 +1,8 @@ | ||
# [1.4.0](https://github.com/sprucelabsai/sprucebot-log/compare/v1.3.1...v1.4.0) (2018-10-23) | ||
### Features | ||
* collect browser page load metrics ([968f86f](https://github.com/sprucelabsai/sprucebot-log/commit/968f86f)) | ||
## [1.3.1](https://github.com/sprucelabsai/sprucebot-log/compare/v1.3.0...v1.3.1) (2018-10-22) | ||
@@ -2,0 +9,0 @@ |
{ | ||
"name": "@sprucelabs/log", | ||
"version": "1.3.1", | ||
"version": "1.4.0", | ||
"publishConfig": { | ||
@@ -5,0 +5,0 @@ "access": "public", |
@@ -6,2 +6,3 @@ // @flow | ||
const SocketAdapter = require('../adapters/Sockets'); | ||
const getTimes = require('../collectors/browser'); | ||
@@ -107,2 +108,18 @@ const CLIENT = typeof window !== 'undefined'; | ||
collectBrowserMetrics() { | ||
if (typeof window !== 'undefined') { | ||
const stats = getTimes(); | ||
this.metric({ | ||
type: 'browserPageLoadStats', | ||
event: 'browserPageLoadStats', | ||
path: window.location.pathname, | ||
...stats | ||
}); | ||
} | ||
} | ||
times() { | ||
return getTimes(); | ||
} | ||
getAdapter() { | ||
@@ -109,0 +126,0 @@ return new HttpAdapter({ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
322198
42
2922