diff --git a/sources/data/usage_stats/usage_stats_31.08.2024/readme.md b/sources/data/usage_stats/usage_stats_31.08.2024/readme.md new file mode 100644 index 00000000..87e5bf09 --- /dev/null +++ b/sources/data/usage_stats/usage_stats_31.08.2024/readme.md @@ -0,0 +1,23 @@ +# SQL command to get those stats + +Needs to be run via the Galaxy Admin Stats Account + +# tool usage last 5 years +```sql +\copy (SELECT DISTINCT REGEXP_REPLACE(j.tool_id, '(.*)/(.*)', '\1') AS tool_name, COUNT(*) AS count FROM job j WHERE j.create_time BETWEEN '2019-08-31' AND '2024-08-31' GROUP BY tool_name ORDER BY count DESC) TO 'tool_usage_5y_until_2024.08.31.csv' WITH CSV HEADER +``` + +# tool usage for ever +```sql +\copy (SELECT DISTINCT REGEXP_REPLACE(j.tool_id, '(.*)/(.*)', '\1') AS tool_name, COUNT(*) AS count FROM job j WHERE j.create_time <= '2024-08-31' GROUP BY tool_name ORDER BY count DESC) TO 'tool_usage_until_2024.08.31.csv' WITH CSV HEADER +``` + +# tool users last 5 years +```sql +\copy (SELECT tool_name, COUNT(*) AS count FROM (SELECT DISTINCT REGEXP_REPLACE(tool_id, '(.*)/(.*)', '\1') AS tool_name, user_id FROM job WHERE create_time BETWEEN '2019-08-31' AND '2024-08-31' GROUP BY tool_name, user_id) AS subquery GROUP BY tool_name ORDER BY count DESC) TO 'tool_users_5y_until_2024.08.31.csv' WITH CSV HEADER +``` + +# tool users for ever +```sql +\copy (SELECT tool_name, COUNT(*) AS count FROM (SELECT DISTINCT REGEXP_REPLACE(tool_id, '(.*)/(.*)', '\1') AS tool_name, user_id FROM job WHERE create_time <= '2024-08-31' GROUP BY tool_name, user_id) AS subquery GROUP BY tool_name ORDER BY count DESC) TO 'tool_users_until_2024.08.31.csv' WITH CSV HEADER +``` \ No newline at end of file