mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-16 06:42:14 +00:00
analytics queries (#1534)
This commit is contained in:
1 parent
f7500a3026
commit
a9e26d1321
6 files changed
+153
No files matched your search
+30
@@ -0,0 +1,30 @@
|
||||
-- Daily active "power users" for ArtCraft since January 1st, 2026.
|
||||
-- A "power user" is a user who created more than 10 ArtCraft inference jobs in the calendar month.
|
||||
-- This query then counts how many such power users were active on each day.
|
||||
|
||||
SELECT
|
||||
DATE(j.created_at) AS day,
|
||||
COUNT(DISTINCT j.maybe_creator_user_token) AS daily_active_power_users
|
||||
FROM generic_inference_jobs j
|
||||
INNER JOIN users u ON u.token = j.maybe_creator_user_token
|
||||
INNER JOIN (
|
||||
SELECT maybe_creator_user_token, DATE_FORMAT(created_at, '%Y-%m') AS month
|
||||
FROM generic_inference_jobs
|
||||
WHERE created_at >= '2026-01-01'
|
||||
AND maybe_creator_user_token IS NOT NULL
|
||||
AND job_type NOT IN (
|
||||
'gpt_sovits', 'tacotron2', 'rvc_v2', 'f5_tts',
|
||||
'so_vits_svc', 'styletts2', 'face_fusion', 'seed_vc', 'comfy_ui'
|
||||
)
|
||||
GROUP BY maybe_creator_user_token, month
|
||||
HAVING COUNT(*) > 10
|
||||
) power ON power.maybe_creator_user_token = j.maybe_creator_user_token
|
||||
AND power.month = DATE_FORMAT(j.created_at, '%Y-%m')
|
||||
WHERE j.created_at >= '2026-01-01'
|
||||
AND j.maybe_creator_user_token IS NOT NULL
|
||||
AND j.job_type NOT IN (
|
||||
'gpt_sovits', 'tacotron2', 'rvc_v2', 'f5_tts',
|
||||
'so_vits_svc', 'styletts2', 'face_fusion', 'seed_vc', 'comfy_ui'
|
||||
)
|
||||
GROUP BY day
|
||||
ORDER BY day DESC;
|
||||
@@ -0,0 +1,24 @@
|
||||
-- Daily active users for ArtCraft since January 1st, 2026.
|
||||
-- A "daily active user" is a user who created at least one ArtCraft inference job that day.
|
||||
|
||||
SELECT
|
||||
DATE(j.created_at) AS day,
|
||||
COUNT(DISTINCT j.maybe_creator_user_token) AS daily_active_users
|
||||
FROM generic_inference_jobs j
|
||||
INNER JOIN users u ON u.token = j.maybe_creator_user_token
|
||||
WHERE j.created_at >= '2026-01-01'
|
||||
AND j.maybe_creator_user_token IS NOT NULL
|
||||
AND j.job_type NOT IN (
|
||||
'gpt_sovits',
|
||||
'tacotron2',
|
||||
'rvc_v2',
|
||||
'f5_tts',
|
||||
'so_vits_svc',
|
||||
'styletts2',
|
||||
'face_fusion',
|
||||
'seed_vc',
|
||||
'comfy_ui'
|
||||
)
|
||||
GROUP BY DATE(j.created_at)
|
||||
ORDER BY day DESC;
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
-- Monthly active "power users" for ArtCraft since January 1st, 2026.
|
||||
-- A "power user" is a user who created more than 10 ArtCraft inference jobs in the calendar month.
|
||||
|
||||
SELECT
|
||||
month,
|
||||
COUNT(*) AS monthly_active_power_users
|
||||
FROM (
|
||||
SELECT
|
||||
maybe_creator_user_token,
|
||||
DATE_FORMAT(j.created_at, '%Y-%m') AS month
|
||||
FROM generic_inference_jobs j
|
||||
INNER JOIN users u ON u.token = j.maybe_creator_user_token
|
||||
WHERE j.created_at >= '2026-01-01'
|
||||
AND j.maybe_creator_user_token IS NOT NULL
|
||||
AND j.job_type NOT IN (
|
||||
'gpt_sovits', 'tacotron2', 'rvc_v2', 'f5_tts',
|
||||
'so_vits_svc', 'styletts2', 'face_fusion', 'seed_vc', 'comfy_ui'
|
||||
)
|
||||
GROUP BY maybe_creator_user_token, month
|
||||
HAVING COUNT(*) > 10
|
||||
) power
|
||||
GROUP BY month
|
||||
ORDER BY month DESC;
|
||||
@@ -0,0 +1,23 @@
|
||||
-- Monthly active users for ArtCraft since January 1st, 2026.
|
||||
-- A "monthly active user" is a user who created at least one ArtCraft inference job that month.
|
||||
|
||||
SELECT
|
||||
DATE_FORMAT(j.created_at, '%Y-%m') AS month,
|
||||
COUNT(DISTINCT j.maybe_creator_user_token) AS monthly_active_users
|
||||
FROM generic_inference_jobs j
|
||||
INNER JOIN users u ON u.token = j.maybe_creator_user_token
|
||||
WHERE j.created_at >= '2026-01-01'
|
||||
AND j.maybe_creator_user_token IS NOT NULL
|
||||
AND j.job_type NOT IN (
|
||||
'gpt_sovits',
|
||||
'tacotron2',
|
||||
'rvc_v2',
|
||||
'f5_tts',
|
||||
'so_vits_svc',
|
||||
'styletts2',
|
||||
'face_fusion',
|
||||
'seed_vc',
|
||||
'comfy_ui'
|
||||
)
|
||||
GROUP BY month
|
||||
ORDER BY month DESC;
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
-- Weekly active "power users" for ArtCraft since January 1st, 2026.
|
||||
-- A "power user" is a user who created more than 10 ArtCraft inference jobs in the calendar month.
|
||||
-- This query then counts how many such power users were active in each week.
|
||||
|
||||
SELECT
|
||||
DATE(DATE_SUB(j.created_at, INTERVAL WEEKDAY(j.created_at) DAY)) AS week_start,
|
||||
COUNT(DISTINCT j.maybe_creator_user_token) AS weekly_active_power_users
|
||||
FROM generic_inference_jobs j
|
||||
INNER JOIN users u ON u.token = j.maybe_creator_user_token
|
||||
INNER JOIN (
|
||||
SELECT maybe_creator_user_token, DATE_FORMAT(created_at, '%Y-%m') AS month
|
||||
FROM generic_inference_jobs
|
||||
WHERE created_at >= '2026-01-01'
|
||||
AND maybe_creator_user_token IS NOT NULL
|
||||
AND job_type NOT IN (
|
||||
'gpt_sovits', 'tacotron2', 'rvc_v2', 'f5_tts',
|
||||
'so_vits_svc', 'styletts2', 'face_fusion', 'seed_vc', 'comfy_ui'
|
||||
)
|
||||
GROUP BY maybe_creator_user_token, month
|
||||
HAVING COUNT(*) > 10
|
||||
) power ON power.maybe_creator_user_token = j.maybe_creator_user_token
|
||||
AND power.month = DATE_FORMAT(j.created_at, '%Y-%m')
|
||||
WHERE j.created_at >= '2026-01-01'
|
||||
AND j.maybe_creator_user_token IS NOT NULL
|
||||
AND j.job_type NOT IN (
|
||||
'gpt_sovits', 'tacotron2', 'rvc_v2', 'f5_tts',
|
||||
'so_vits_svc', 'styletts2', 'face_fusion', 'seed_vc', 'comfy_ui'
|
||||
)
|
||||
GROUP BY week_start
|
||||
ORDER BY week_start DESC;
|
||||
@@ -0,0 +1,23 @@
|
||||
-- Weekly active users for ArtCraft since January 1st, 2026.
|
||||
-- A "weekly active user" is a user who created at least one ArtCraft inference job that week.
|
||||
|
||||
SELECT
|
||||
DATE(DATE_SUB(j.created_at, INTERVAL WEEKDAY(j.created_at) DAY)) AS week_start,
|
||||
COUNT(DISTINCT j.maybe_creator_user_token) AS weekly_active_users
|
||||
FROM generic_inference_jobs j
|
||||
INNER JOIN users u ON u.token = j.maybe_creator_user_token
|
||||
WHERE j.created_at >= '2026-01-01'
|
||||
AND j.maybe_creator_user_token IS NOT NULL
|
||||
AND j.job_type NOT IN (
|
||||
'gpt_sovits',
|
||||
'tacotron2',
|
||||
'rvc_v2',
|
||||
'f5_tts',
|
||||
'so_vits_svc',
|
||||
'styletts2',
|
||||
'face_fusion',
|
||||
'seed_vc',
|
||||
'comfy_ui'
|
||||
)
|
||||
GROUP BY week_start
|
||||
ORDER BY week_start DESC;
|
||||
Reference in new issue
Block a user