Is skyview message-rate buffered/smoothed?


#1

sorry - but i don’t find the the place where this is done. is this the delta between last and actual ‘messages’ divided through delta from last and actual ‘now’ in aircraft.json or stacked data over some seconds?

was looking in public_html/script.js but did not find the code?


#2

tl;dr: it is measured over a 30 second sliding window



#3

haha - no - not too long didn’t read - more td;tf ‘too dumb to find’ :slight_smile:
thanx!


#4

btw. was not just td;tf: but moreover to dumb to write short code - my solution was:

$message_rate_array[$ac_messages_total] = $ac_now;
foreach ($message_rate_array as $key => $value) {
	if (time() - $value > 30) {
		unset($message_rate_array[$key]);
	}
}
$delta_message_number = max(array_keys($message_rate_array)) - min(array_keys($message_rate_array));
$delta_message_time = max($message_rate_array) - min($message_rate_array);
$delta_message_time > 0 ? $message_rate = $delta_message_number / $delta_message_time : $message_rate = 0;

but then saw your coding - and stole it :slight_smile:

$message_rate_array[] = array('messages' => $ac_messages_total, 'time' => $ac_now);
if (time() - $message_rate_array[0]['time'] > 30) array_shift($message_rate_array);
$delta_message_number = $message_rate_array[count($message_rate_array) - 1]['messages'] - $message_rate_array[0]['messages'];
$delta_message_time =  $message_rate_array[count($message_rate_array) - 1]['time'] - $message_rate_array[0]['time'];
$delta_message_time > 0 ? $message_rate = round($delta_message_number / $delta_message_time, '1') : $message_rate = 0;