femonitor-web
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "femonitor-web", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "A web SDK for frontend error and performance monnitor", | ||
@@ -29,3 +29,3 @@ "author": { | ||
"watch": "cross-env NODE_ENV=production EXTERNAL=1 rollup -c --watch -f umd -o dist/index.umd.js", | ||
"server": "nodemon --watch server --exec \"ts-node\" ./server/app.ts", | ||
"server": "nodemon --watch server --exec \"npx ts-node\" ./server/app.ts", | ||
"build": "npm run lint && npm run clean && npm run build:esm && npm run build:umd && npm run build:min", | ||
@@ -32,0 +32,0 @@ "build:esm": "cross-env NODE_ENV=production EXTERNAL=1 rollup -c -f esm -o dist/index.js", |
# Description | ||
A SDK for web error and performance monitor using event subscription | ||
# Feature | ||
- [x] Error observe, includes js error, unhandle rejection error, http error and resource error | ||
- [x] Error sampling, support errors collection emit events for report optimization | ||
- [x] Error sampling, support errors collection emit events for report optimization | ||
- [x] Observe page performance | ||
@@ -17,5 +19,7 @@ - [x] Observe user behaviors, includes console, user click event | ||
npm run watch // Watch tsfile change and compile by rollup | ||
npm run server // Start a nodejs server for request test | ||
npm run server // Start a nodejs test server | ||
``` | ||
Then visit `localhost:3000` for example test | ||
# Build | ||
@@ -57,3 +61,3 @@ | ||
/* Or Listen all event */ | ||
monitor.on("event", (eventName, emitData) => {}) | ||
monitor.on("event", (eventName, emitData) => {}); | ||
``` | ||
@@ -66,15 +70,15 @@ | ||
export const defaultTrackerOptions = { | ||
env: 'dev', | ||
env: "dev", | ||
reportUrl: "", | ||
data: {}, | ||
error: { | ||
watch: true, // If listen all error | ||
random: 1, // Sampling rate from 0 to 1, 1 means emit all error | ||
repeat: 5, // Don't emit sample error events when exceed 5 times | ||
delay: 1000 // Delay emit event after 1000 ms | ||
watch: true, // If listen all error | ||
random: 1, // Sampling rate from 0 to 1, 1 means emit all error | ||
repeat: 5, // Don't emit sample error events when exceed 5 times | ||
delay: 1000 // Delay emit event after 1000 ms | ||
}, | ||
performance: false, // If want to collect performance data | ||
performance: false, // If want to collect performance data | ||
http: { | ||
fetch: true, // If listen request use fetch interface | ||
ajax: true // If listen ajax request | ||
fetch: true, // If listen request use fetch interface | ||
ajax: true // If listen ajax request | ||
}, | ||
@@ -84,4 +88,4 @@ behavior: { | ||
console: [ConsoleType.error], | ||
click: true, // If set to true will listen all dom click event | ||
queueLimit: 20 // Limit behavior queue to 20 | ||
click: true, // If set to true will listen all dom click event | ||
queueLimit: 20 // Limit behavior queue to 20 | ||
}, | ||
@@ -94,6 +98,6 @@ /** | ||
watch: false, | ||
queueLimit: 50, // Limit rrweb queue to 20 | ||
delay: 1000 // Emit event after 1000 ms | ||
queueLimit: 50, // Limit rrweb queue to 20 | ||
delay: 1000 // Emit event after 1000 ms | ||
}, | ||
isSpa: true // If watch is true, globalData can get _spaUrl for report when route change | ||
isSpa: true // If watch is true, globalData can get _spaUrl for report when route change | ||
}; | ||
@@ -150,2 +154,1 @@ const monitor = Monitor.init(defaultTrackerOptions); | ||
| event | Includes all events above | | ||
@@ -287,3 +287,3 @@ import merge from "deepmerge"; | ||
setTimeout(() => { | ||
myEmitter.emit(TrackerEvents.mouseTrack, this.rrwebQueue); | ||
myEmitter.customEmit(TrackerEvents.mouseTrack, this.rrwebQueue); | ||
}, this.$options.rrweb.delay); | ||
@@ -290,0 +290,0 @@ }); |
@@ -83,3 +83,3 @@ import { TrackerEvents } from "../types/index"; | ||
myEmitter.emit(TrackerEvents.performanceInfoReady, performanceInfo); | ||
myEmitter.customEmit(TrackerEvents.performanceInfoReady, performanceInfo); | ||
} | ||
@@ -86,0 +86,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
1443219
11798
149