-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa65372
commit 957d094
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` |