Skip to content

armgit / mwmbl

Public Imported from GitHub
0

An open source, non-profit web search engine

Merge main

blueheron7860004c2a072dd
diff --git a/mwmbl/crawler/stats.py b/mwmbl/crawler/stats.py
index 5f57a2a..f7883f3 100644
--- a/mwmbl/crawler/stats.py
+++ b/mwmbl/crawler/stats.py
@@ -1,15 +1,11 @@
-import gzip
from datetime import date, datetime, timedelta, timezone
-from glob import glob
-from itertools import islice
from logging import getLogger
-import django
from pydantic import BaseModel
from redis import Redis
from mwmbl.count_urls import get_counts, get_domain_result_count
-from mwmbl.crawler.batch import HashedBatch, Results
+from mwmbl.crawler.batch import Results
from mwmbl.utils import utc_today
logger = getLogger(__name__)
@@ -89,6 +85,7 @@ class StatsManager:
def __init__(self, redis: Redis):
self.redis = redis
+
def get_stats(self) -> MwmblStats:
date_time = datetime.now(timezone.utc)
date = date_time.date()
diff --git a/mwmbl/platform/schemas.py b/mwmbl/platform/schemas.py
index 104f6a6..35273a1 100644
--- a/mwmbl/platform/schemas.py
+++ b/mwmbl/platform/schemas.py
@@ -23,6 +23,14 @@ class UserStatsResponse(Schema):
results_indexed_daily: dict[str, int]
+class UserStatsResponse(Schema):
+ """Per-user contribution stats for the logged-in user."""
+
+ username: str
+ results_indexed_today: int
+ results_indexed_daily: dict[str, int]
+
+
class SubscriptionResponse(Schema):
status: str
max_monthly_spend_cents: int