Skip to content

Commit

Permalink
stats reason
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoCasa committed Sep 25, 2024
1 parent d4b6708 commit 82ec0a9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion backend/windmill-api/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,13 @@ async fn list_global_settings() -> JsonResult<String> {

pub async fn send_stats(Extension(db): Extension<DB>, authed: ApiAuthed) -> Result<String> {
require_super_admin(&db, &authed.email).await?;
windmill_common::stats_ee::send_stats(&HTTP_CLIENT, &db, true, true).await?;
windmill_common::stats_ee::send_stats(
&HTTP_CLIENT,
&db,
true,
windmill_common::stats_ee::SendStatsReason::Manual,
)
.await?;

Ok("Sent stats".to_string())
}
Expand Down
8 changes: 7 additions & 1 deletion backend/windmill-common/src/stats_ee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ struct JobsUsage {
count: i64,
}

pub enum SendStatsReason {
Manual,
Schedule,
OnStart,
}

pub async fn send_stats(
_http_client: &reqwest::Client,
_db: &DB,
_skip_job_usage: bool,
_manual: bool,
_reason: SendStatsReason,
) -> Result<()> {
// stats details are closed source
Ok(())
Expand Down

0 comments on commit 82ec0a9

Please sign in to comment.