1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 21:05:35 +03:00

analytics overhaul

This commit is contained in:
cTn 2014-07-16 12:59:12 +02:00
parent fb7cbe0c8f
commit 1885fba5a0
17 changed files with 38 additions and 48 deletions

View file

@ -23,7 +23,7 @@ var serial = {
self.onReceiveError.addListener(function watch_for_on_receive_errors(info) {
console.error(info);
ga_tracker.sendEvent('Error', 'Serial', info.error);
googleAnalytics.sendEvent('Error', 'Serial', info.error);
switch (info.error) {
case 'system_error': // we might be able to recover from this one
@ -36,11 +36,11 @@ var serial = {
function crunch_status(info) {
if (!info.paused) {
console.log('SERIAL: Connection recovered from last onReceiveError');
ga_tracker.sendEvent('Error', 'Serial', 'recovered');
googleAnalytics.sendEvent('Error', 'Serial', 'recovered');
} else {
console.log('SERIAL: Connection did not recover from last onReceiveError, disconnecting');
GUI.log('Unrecoverable <span style="color: red">failure</span> of serial connection, disconnecting...');
ga_tracker.sendEvent('Error', 'Serial', 'unrecoverable');
googleAnalytics.sendEvent('Error', 'Serial', 'unrecoverable');
if (GUI.connected_to || GUI.connecting_to) {
$('a.connect').click();
@ -67,7 +67,7 @@ var serial = {
if (callback) callback(connectionInfo);
} else {
console.log('SERIAL: Failed to open serial port');
ga_tracker.sendEvent('Error', 'Serial', 'FailedToOpen');
googleAnalytics.sendEvent('Error', 'Serial', 'FailedToOpen');
if (callback) callback(false);
}
});
@ -91,7 +91,7 @@ var serial = {
console.log('SERIAL: Connection with ID: ' + self.connectionId + ' closed');
} else {
console.log('SERIAL: Failed to close connection with ID: ' + self.connectionId + ' closed');
ga_tracker.sendEvent('Error', 'Serial', 'FailedToClose');
googleAnalytics.sendEvent('Error', 'Serial', 'FailedToClose');
}
console.log('SERIAL: Statistics - Sent: ' + self.bytes_sent + ' bytes, Received: ' + self.bytes_received + ' bytes');