Skip to content

Commit

Permalink
add readme for stats
Browse files Browse the repository at this point in the history
  • Loading branch information
paulzierep committed Oct 2, 2024
1 parent fa65372 commit 957d094
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions sources/data/usage_stats/usage_stats_31.08.2024/readme.md
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
```

0 comments on commit 957d094

Please sign in to comment.