feature: Save application metrics to db for alerting (#7828)

* feature: save application metrics to db for alerting
However, alerting will not work because ResolveGlues() is broken.
Can add workaround after state_translations alerting is merged

Does not update all applications yet, not sure if that should be done here or in another PR.

Introduces two handy functions dbDeleteOrphans() and array_by_column().  Will replace those in other locations after this is merged or separate them out if this is not merged.

* remove accidental inclusions

* Add db schema
This commit is contained in:
Tony Murray
2017-12-01 01:53:26 -06:00
committed by Neil Lathwood
parent edf26c1106
commit 4a03e7838e
7 changed files with 104 additions and 4 deletions

View File

@@ -1866,3 +1866,15 @@ function check_file_permissions($file, $mask)
return ($perms & $mask) === $mask;
}
/**
* Index an array by a column
*
* @param array $array
* @param string|int $column
* @return array
*/
function array_by_column($array, $column)
{
return array_combine(array_column($array, $column), $array);
}