mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-05 00:14:35 -04:00
Capture additional metrics
This commit is contained in:
parent
a1fa52dfd3
commit
aaae12e691
@ -52,6 +52,10 @@ class DbQuery extends GenericMixedMetric
|
|||||||
|
|
||||||
public $string_metric7 = 'ip_address';
|
public $string_metric7 = 'ip_address';
|
||||||
|
|
||||||
|
public $string_metric8 = 'client_version';
|
||||||
|
|
||||||
|
public $string_metric9 = 'platform';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The counter
|
* The counter
|
||||||
* set to 1.
|
* set to 1.
|
||||||
|
@ -73,7 +73,22 @@ class QueryLogging
|
|||||||
$ip = $request->ip();
|
$ip = $request->ip();
|
||||||
}
|
}
|
||||||
|
|
||||||
LightLogs::create(new DbQuery($request->method(), substr(urldecode($request->url()), 0, 180), $count, $time, $ip))
|
$client_version = '';
|
||||||
|
$platform = '';
|
||||||
|
|
||||||
|
if ($request->hasHeader('X-CLIENT-PLATFORM')) {
|
||||||
|
$platform = $request->header('X-CLIENT-PLATFORM');
|
||||||
|
}
|
||||||
|
elseif($request->hasHeader('X-React')){
|
||||||
|
$platform = 'react';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->hasHeader('X-CLIENT-VERSION'))
|
||||||
|
{
|
||||||
|
$client_version = $request->header('X-CLIENT-VERSION');
|
||||||
|
}
|
||||||
|
|
||||||
|
LightLogs::create(new DbQuery($request->method(), substr(urldecode($request->url()), 0, 180), $count, $time, $ip, $client_version, $platform))
|
||||||
->batch();
|
->batch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ class AccountFactory extends Factory
|
|||||||
'default_company_id' => 1,
|
'default_company_id' => 1,
|
||||||
'key' => Str::random(32),
|
'key' => Str::random(32),
|
||||||
'report_errors' => 1,
|
'report_errors' => 1,
|
||||||
|
'referral_code' => Str::lower(Str::random(32)),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user