mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
analytics overhaul
This commit is contained in:
parent
fb7cbe0c8f
commit
1885fba5a0
17 changed files with 38 additions and 48 deletions
10
js/serial.js
10
js/serial.js
|
@ -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');
|
||||
|
|
|
@ -143,7 +143,7 @@ STM32_protocol.prototype.initialize = function() {
|
|||
} else {
|
||||
console.log('STM32 - timed out, programming failed ...');
|
||||
GUI.log('STM32 - timed out, programming: <strong style="color: red">FAILED</strong>');
|
||||
ga_tracker.sendEvent('Flashing', 'Programming', 'timeout');
|
||||
googleAnalytics.sendEvent('Flashing', 'Programming', 'timeout');
|
||||
|
||||
// protocol got stuck, clear timer and disconnect
|
||||
GUI.interval_remove('STM32_timeout');
|
||||
|
@ -589,7 +589,7 @@ STM32_protocol.prototype.upload_procedure = function(step) {
|
|||
if (verify) {
|
||||
console.log('Programming: SUCCESSFUL');
|
||||
GUI.log('Programming: <strong style="color: green">SUCCESSFUL</strong>');
|
||||
ga_tracker.sendEvent('Flashing', 'Programming', 'success');
|
||||
googleAnalytics.sendEvent('Flashing', 'Programming', 'success');
|
||||
|
||||
// update progress bar
|
||||
self.progress_bar_e.addClass('valid');
|
||||
|
@ -599,7 +599,7 @@ STM32_protocol.prototype.upload_procedure = function(step) {
|
|||
} else {
|
||||
console.log('Programming: FAILED');
|
||||
GUI.log('Programming: <strong style="color: red">FAILED</strong>');
|
||||
ga_tracker.sendEvent('Flashing', 'Programming', 'fail');
|
||||
googleAnalytics.sendEvent('Flashing', 'Programming', 'fail');
|
||||
|
||||
// update progress bar
|
||||
self.progress_bar_e.addClass('invalid');
|
||||
|
|
|
@ -421,7 +421,7 @@ STM32DFU_protocol.prototype.upload_procedure = function(step) {
|
|||
if (verify) {
|
||||
console.log('Programming: SUCCESSFUL');
|
||||
GUI.log('Programming: <strong style="color: green">SUCCESSFUL</strong>');
|
||||
ga_tracker.sendEvent('Flashing', 'Programming', 'success');
|
||||
googleAnalytics.sendEvent('Flashing', 'Programming', 'success');
|
||||
|
||||
// update progress bar
|
||||
self.progress_bar_e.addClass('valid');
|
||||
|
@ -431,7 +431,7 @@ STM32DFU_protocol.prototype.upload_procedure = function(step) {
|
|||
} else {
|
||||
console.log('Programming: FAILED');
|
||||
GUI.log('Programming: <strong style="color: red">FAILED</strong>');
|
||||
ga_tracker.sendEvent('Flashing', 'Programming', 'fail');
|
||||
googleAnalytics.sendEvent('Flashing', 'Programming', 'fail');
|
||||
|
||||
// update progress bar
|
||||
self.progress_bar_e.addClass('invalid');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue