Skip to content

Commit 00536c4

Browse files
committed
add statistics SQL query
1 parent 29cc900 commit 00536c4

File tree

6 files changed

+17
-7
lines changed

6 files changed

+17
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
.DS_Store
55
.direnv/
66
.tmp/
7+
.vscode/
78
target
89
target-*
910
test-results.xml
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
select
2+
content->>'digest' as snapshot_digest,
3+
date(created_at) as downloaded_at,
4+
count(*) as downloads
5+
from event
6+
where
7+
source = 'HTTP::statistics'
8+
and action = 'snapshot_downloaded'
9+
group by 1, 2
10+
order by
11+
downloaded_at desc,
12+
downloads desc
13+

mithril-aggregator/.vscode/settings.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

mithril-aggregator/src/http_server/routes/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ mod reply;
66
pub mod router;
77
mod signatures_routes;
88
mod signer_routes;
9-
mod statistics;
9+
mod statistics_routes;

mithril-aggregator/src/http_server/routes/router.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use crate::http_server::routes::{
22
artifact_routes, certificate_routes, epoch_routes, signatures_routes, signer_routes,
3+
statistics_routes,
34
};
45
use crate::http_server::SERVER_BASE_PATH;
56
use crate::DependencyContainer;
@@ -14,8 +15,6 @@ use warp::http::Method;
1415
use warp::reject::Reject;
1516
use warp::{Filter, Rejection, Reply};
1617

17-
use super::statistics;
18-
1918
#[derive(Debug)]
2019
pub struct VersionMismatchError;
2120

@@ -51,7 +50,7 @@ pub fn routes(
5150
.or(signer_routes::routes(dependency_manager.clone()))
5251
.or(signatures_routes::routes(dependency_manager.clone()))
5352
.or(epoch_routes::routes(dependency_manager.clone()))
54-
.or(statistics::routes(dependency_manager.clone()))
53+
.or(statistics_routes::routes(dependency_manager.clone()))
5554
.with(cors),
5655
)
5756
.recover(handle_custom)
File renamed without changes.

0 commit comments

Comments
 (0)