Skip to content

Commit

Permalink
added statement logging to nym-api db
Browse files Browse the repository at this point in the history
  • Loading branch information
jstuczyn committed Nov 22, 2024
1 parent 01c7b28 commit b7f5a29
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions nym-api/src/support/storage/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright 2021 - Nym Technologies SA <[email protected]>
// SPDX-License-Identifier: GPL-3.0-only

use self::manager::{AvgGatewayReliability, AvgMixnodeReliability};
use crate::network_monitor::test_route::TestRoute;
use crate::node_status_api::models::{
GatewayStatusReport, GatewayUptimeHistory, HistoricalUptime as ApiHistoricalUptime,
Expand All @@ -16,11 +17,11 @@ use nym_mixnet_contract_common::NodeId;
use nym_types::monitoring::NodeResult;
use sqlx::ConnectOptions;
use std::path::Path;
use std::time::Duration;
use time::{Date, OffsetDateTime};
use tracing::log::LevelFilter;
use tracing::{error, info, warn};

use self::manager::{AvgGatewayReliability, AvgMixnodeReliability};

pub(crate) mod manager;
pub(crate) mod models;

Expand All @@ -37,7 +38,8 @@ impl NymApiStorage {
let opts = sqlx::sqlite::SqliteConnectOptions::new()
.filename(database_path)
.create_if_missing(true)
.disable_statement_logging();
.log_statements(LevelFilter::Trace)
.log_slow_statements(LevelFilter::Warn, Duration::from_millis(250));

// TODO: do we want auto_vacuum ?

Expand Down

0 comments on commit b7f5a29

Please sign in to comment.