},
],
'host_info_git' => [
+ /*
+ ,0 as count
+ ,(SELECT string_agg((name.val),' ') as repos FROM host_info name WHERE name.host=hi.host AND name.key LIKE 'git.%.name') as repos
+ */
'sql' => preg_replace('/[\t\r\n]/','',"
SELECT host
,max(updated) as last_updated
,min(updated) as first_updated
- ,0 as count
- ,(SELECT max(CAST(ex.val as INTEGER)) as exit FROM host_info ex
+ ,(SELECT count(count.val) FROM host_info count
+ WHERE count.host=hi.host AND count.key LIKE 'git.%.name'
+ ) as count
+ ,(SELECT max(CAST(ex.val as INTEGER)) FROM host_info ex
WHERE ex.host=hi.host AND ex.key LIKE 'git.%.exit_code'
) as exit
- ,(SELECT string_agg((name.val),' ') as repos FROM host_info name WHERE name.host=hi.host AND name.key LIKE 'git.%.name') as repos
FROM host_info hi
WHERE key LIKE 'git.%'
GROUP BY host ORDER BY last_updated DESC, host