Skip to content

Commit 9fb020d

Browse files
committed
Make aggregator record SnapshotDownloadMessage
1 parent 72da717 commit 9fb020d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,22 @@ fn post_statistics(
2626
mod handlers {
2727
use std::{convert::Infallible, sync::Arc};
2828

29-
use mithril_common::messages::SnapshotMessage;
29+
use mithril_common::messages::SnapshotDownloadMessage;
3030
use reqwest::StatusCode;
3131

3232
use crate::event_store::{EventMessage, TransmitterService};
3333
use crate::http_server::routes::reply;
3434

3535
pub async fn post_snapshot_statistics(
36-
snapshot_message: SnapshotMessage,
36+
snapshot_download_message: SnapshotDownloadMessage,
3737
event_transmitter: Arc<TransmitterService<EventMessage>>,
3838
) -> Result<impl warp::Reply, Infallible> {
3939
let headers: Vec<(&str, &str)> = Vec::new();
4040

4141
match event_transmitter.send_event_message(
4242
"HTTP::statistics",
4343
"snapshot_downloaded",
44-
&snapshot_message,
44+
&snapshot_download_message,
4545
headers,
4646
) {
4747
Err(e) => Ok(reply::internal_server_error(e)),
@@ -54,7 +54,7 @@ mod handlers {
5454
mod tests {
5555
use super::*;
5656

57-
use mithril_common::messages::SnapshotMessage;
57+
use mithril_common::messages::SnapshotDownloadMessage;
5858
use mithril_common::test_utils::apispec::APISpec;
5959

6060
use warp::{http::Method, test::request};
@@ -82,14 +82,14 @@ mod tests {
8282
let mut builder = DependenciesBuilder::new(config);
8383
let mut rx = builder.get_event_transmitter_receiver().await.unwrap();
8484
let dependency_manager = builder.build_dependency_container().await.unwrap();
85-
let snapshot_message = SnapshotMessage::dummy();
85+
let snapshot_download_message = SnapshotDownloadMessage::dummy();
8686

8787
let method = Method::POST.as_str();
8888
let path = "/statistics/snapshot";
8989

9090
let response = request()
9191
.method(method)
92-
.json(&snapshot_message)
92+
.json(&snapshot_download_message)
9393
.path(&format!("/{SERVER_BASE_PATH}{path}"))
9494
.reply(&setup_router(Arc::new(dependency_manager)))
9595
.await;
@@ -99,7 +99,7 @@ mod tests {
9999
method,
100100
path,
101101
"application/json",
102-
&snapshot_message,
102+
&snapshot_download_message,
103103
&response,
104104
);
105105

0 commit comments

Comments
 (0)