From 1dcab5644b1e2f1477f7e52a69472c43892fea67 Mon Sep 17 00:00:00 2001 From: Victor Mustar Date: Tue, 22 Oct 2024 15:24:01 +0200 Subject: [PATCH] document analytics --- docs/hub/_toctree.yml | 2 + docs/hub/enterprise-hub-analytics.md | 71 ++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 docs/hub/enterprise-hub-analytics.md diff --git a/docs/hub/_toctree.yml b/docs/hub/_toctree.yml index 8c43b3f19..8cdff0132 100644 --- a/docs/hub/_toctree.yml +++ b/docs/hub/_toctree.yml @@ -338,6 +338,8 @@ title: Advanced Compute Options - local: enterprise-hub-tokens-management title: Tokens Management + - local: enterprise-hub-analytics + title: Analytics - local: billing title: Billing - local: security diff --git a/docs/hub/enterprise-hub-analytics.md b/docs/hub/enterprise-hub-analytics.md new file mode 100644 index 000000000..74a5e1849 --- /dev/null +++ b/docs/hub/enterprise-hub-analytics.md @@ -0,0 +1,71 @@ +# Analytics + + +This feature is part of the Enterprise Hub. + + +## Analytics Dashboard + +Track all your repository activity with a detailed downloads overview that shows total downloads for all your Models and Datasets. Toggle between "All Time" and "Last Month" views to gain insights into your repository's downloads over different periods. + +
+screenshot of the Dataset Viewer on a private dataset owned by an Enterprise Hub organization. + +
+ +### Per-repo breakdown + +Explore the metrics of individual repositories with the per-repository drill-down table. Utilize the built-in search feature to quickly locate specific repositories. Each row also features a time-series graph that illustrates the trend of downloads over time. + +## Export Analytics as JSON + +Download a comprehensive JSON file containing analytics for all your repositories, including model and dataset download activity. + +### Response Structure + +```json +[ + { + "repoType": "model", + "repoName": "huggingface/CodeBERTa-small-v1", + "totalDownloads": 4362460, + "records": [ + { + "timestamp": "2021-01-22T00:00:00.000Z", + "downloads": 4 + } + // ... daily records + ] + }, + { + "repoType": "dataset", + "repoName": "huggingface/documentation-images", + "totalDownloads": 2167284, + "records": [ + { + "timestamp": "2021-11-27T00:00:00.000Z", + "downloads": 4 + } + // ... daily records + ] + } +] +``` + +### Repository Object Structure + +Each repository object contains: + +- `repoType`: The type of repository (e.g., "model", "dataset") +- `repoName`: Full repository name including organization (e.g., "huggingface/documentation-images") +- `totalDownloads`: Cumulative number of downloads (can be 0 for repositories with no activity) +- `records`: Array of daily download entries (can be empty for repositories with no activity) + +### Download History + +For repositories with download activity, each record in the `records` array includes: + +- `timestamp`: ISO 8601 formatted date (UTC) +- `downloads`: Number of downloads for that day + +Records are ordered chronologically and provide a daily granular view of download activity for each repository.