Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

endpoint to get statistics of geohub usage #4507

Open
JinIgarashi opened this issue Nov 19, 2024 · 1 comment
Open

endpoint to get statistics of geohub usage #4507

JinIgarashi opened this issue Nov 19, 2024 · 1 comment
Assignees
Labels

Comments

@JinIgarashi JinIgarashi self-assigned this Nov 19, 2024
@JinIgarashi
Copy link
Contributor Author

-- 1.1 Total number of log-ins

SELECT count(*) FROM geohub.users where signupat > '2024-01-01'

-- 2.2 Number of user-uploaded and downloaded datasets

SELECT count(*) FROM geohub.dataset where createdat > '2024-01-01'

-- 2.2.1 By country

WITH country_tag as (
SELECT id, key, value
FROM geohub.tag
WHERE key = 'country'
)
SELECT count(*) 
FROM geohub.dataset a
INNER JOIN geohub.dataset_tag b
ON a.id = b.dataset_id
where createdat > '2024-01-01'
AND exists(select id FROM country_tag WHERE id = b.tag_id)

-- 2.2.2 By region

WITH country_tag as (
SELECT id, key, value
FROM geohub.tag
WHERE key = 'region' or key = 'continent'
)
SELECT count(*) 
FROM geohub.dataset a
INNER JOIN geohub.dataset_tag b
ON a.id = b.dataset_id
where createdat > '2024-01-01'
AND exists(select id FROM country_tag WHERE id = b.tag_id)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant