mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
refactor: Update all applications to store metrics (#7853)
* Update all applications to store metrics * fix db schema * Add glue test
This commit is contained in:
committed by
Neil Lathwood
co-authored by
Neil Lathwood
parent
0dd3ec25d3
commit
b620692426
+7
-3
@@ -1372,12 +1372,16 @@ function ResolveGlues($tables, $target, $x = 0, $hist = array(), $last = array()
|
||||
foreach ($tables as $table) {
|
||||
if ($table == 'state_translations' && ($target == 'device_id' || $target == 'sensor_id')) {
|
||||
// workaround for state_translations
|
||||
$st_tables = array(
|
||||
return array_merge($last, array(
|
||||
'state_translations.state_index_id',
|
||||
'sensors_to_state_indexes.sensor_id',
|
||||
"sensors.$target",
|
||||
);
|
||||
return array_merge($last, $st_tables);
|
||||
));
|
||||
} elseif ($table == 'application_metrics' && $target = 'device_id') {
|
||||
return array_merge($last, array(
|
||||
'application_metrics.app_id',
|
||||
"applications.$target",
|
||||
));
|
||||
}
|
||||
|
||||
$glues = dbFetchRows('SELECT COLUMN_NAME FROM information_schema.COLUMNS WHERE TABLE_NAME = ? && COLUMN_NAME LIKE "%\_id"', array($table));
|
||||
|
||||
Reference in New Issue
Block a user