...
|
...
|
@@ -2,6 +2,7 @@ const msg2row = require('./msg2row'); |
|
|
const Sender = require('influx-batch-sender');
|
|
|
const MysqlSender = require('../lib/mysql-sender');
|
|
|
const ipService = require('./ip-service');
|
|
|
const useragent = require('useragent');
|
|
|
|
|
|
const _ = require('lodash');
|
|
|
|
...
|
...
|
@@ -110,6 +111,8 @@ function handleClientFirst(scope, item) { |
|
|
}
|
|
|
|
|
|
async function handleClientTiming(scope, item) {
|
|
|
const agent = useragent.lookup(scope.useragent);
|
|
|
|
|
|
const data = {
|
|
|
app: scope.app,
|
|
|
reqid: item.rid,
|
...
|
...
|
@@ -129,9 +132,13 @@ async function handleClientTiming(scope, item) { |
|
|
pageLoadTime: _.parseInt(item.rrt),
|
|
|
screenWidth: _.parseInt(item.sw),
|
|
|
screenHeight: _.parseInt(item.sh),
|
|
|
os: item.pf,
|
|
|
useragent: scope.useragent,
|
|
|
os: item.pf,
|
|
|
ip: scope.ip,
|
|
|
browserName: agent.family,
|
|
|
browserVersion: agent.toVersion(),
|
|
|
osName: agent.family,
|
|
|
osVersion: agent.toVersion()
|
|
|
};
|
|
|
|
|
|
const ipInfo = await ipService.getIsp(scope.ip).catch(() => {});
|
...
|
...
|
|