Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,20 @@ disallowed-methods = [
{ path = "std::process::id", reason = "a process id differs between the recording process and the replay process; use common_utils::process_id" },
{ path = "gethostname::gethostname", reason = "a hostname differs between the recording host and the replay host; use common_utils::hostname, which reads HOSTNAME from the environment (the pod name under Kubernetes)" },
{ path = "rand::random", reason = "a random draw outside a seam cannot be reproduced on replay; use common_utils" },
{ path = "std::collections::HashMap::new", reason = "the facade's constructor builds a map whose order replays; disallowed-types sees a type position and not a constructor path, so this covers a fully-qualified call; use common_utils::collections" },
{ path = "std::collections::HashMap::with_capacity", reason = "the facade's constructor builds a map whose order replays; disallowed-types sees a type position and not a constructor path, so this covers a fully-qualified call; use common_utils::collections" },
{ path = "std::collections::HashSet::new", reason = "the facade's constructor builds a map whose order replays; disallowed-types sees a type position and not a constructor path, so this covers a fully-qualified call; use common_utils::collections" },
{ path = "std::collections::HashSet::with_capacity", reason = "the facade's constructor builds a map whose order replays; disallowed-types sees a type position and not a constructor path, so this covers a fully-qualified call; use common_utils::collections" },
]

disallowed-macros = [
{ path = "nanoid::nanoid", reason = "a nanoid is drawn from entropy and cannot be reproduced on replay; use common_utils::generate_nanoid_with_default_alphabet, or generate_id / generate_id_with_len for the consts::ALPHABETS variants" },
]

# A std HashMap iterates in an order drawn from per-process entropy, so a replay
# renders it differently than the recording did. The facade's aliases are the
# same types with a hasher that follows the request under the `deja` feature.
disallowed-types = [
{ path = "std::collections::HashMap", reason = "iteration order cannot be reproduced on replay; use common_utils::collections::HashMap", replacement = "common_utils::collections::HashMap" },
{ path = "std::collections::HashSet", reason = "iteration order cannot be reproduced on replay; use common_utils::collections::HashSet", replacement = "common_utils::collections::HashSet" },
]
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions crates/analytics/src/active_payments/core.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use std::collections::HashMap;

use api_models::analytics::{
active_payments::{
ActivePaymentsMetrics, ActivePaymentsMetricsBucketIdentifier, MetricsBucketResponse,
},
AnalyticsMetadata, GetActivePaymentsMetricRequest, MetricsResponse,
};
use common_utils::collections::HashMap;
use error_stack::ResultExt;
use router_env::{instrument, logger, tracing};

Expand Down
3 changes: 1 addition & 2 deletions crates/analytics/src/active_payments/metrics.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use std::collections::HashSet;

use api_models::analytics::{
active_payments::{ActivePaymentsMetrics, ActivePaymentsMetricsBucketIdentifier},
Granularity, TimeRange,
};
use common_utils::collections::HashSet;
use time::PrimitiveDateTime;

use crate::{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use std::collections::HashSet;

use api_models::analytics::{
active_payments::ActivePaymentsMetricsBucketIdentifier, Granularity, TimeRange,
};
use common_utils::errors::ReportSwitchExt;
use common_utils::{collections::HashSet, errors::ReportSwitchExt};
use error_stack::ResultExt;
use time::PrimitiveDateTime;

Expand Down
4 changes: 1 addition & 3 deletions crates/analytics/src/api_event/core.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::collections::HashMap;

use api_models::analytics::{
api_event::{
ApiEventMetricsBucketIdentifier, ApiEventMetricsBucketValue, ApiLogsRequest,
Expand All @@ -8,7 +6,7 @@ use api_models::analytics::{
AnalyticsMetadata, ApiEventFiltersResponse, GetApiEventFiltersRequest,
GetApiEventMetricRequest, MetricsResponse,
};
use common_utils::errors::ReportSwitchExt;
use common_utils::{collections::HashMap, errors::ReportSwitchExt};
use error_stack::ResultExt;
use router_env::{
instrument, logger,
Expand Down
3 changes: 1 addition & 2 deletions crates/analytics/src/api_event/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ use crate::{
mod api_count;
pub mod latency;
mod status_code_count;
use std::collections::HashSet;

use api_count::ApiCount;
use common_utils::collections::HashSet;
use latency::MaxLatency;
use status_code_count::StatusCodeCount;

Expand Down
4 changes: 1 addition & 3 deletions crates/analytics/src/api_event/metrics/api_count.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use std::collections::HashSet;

use api_models::analytics::{
api_event::{ApiEventDimensions, ApiEventFilters, ApiEventMetricsBucketIdentifier},
Granularity, TimeRange,
};
use common_utils::errors::ReportSwitchExt;
use common_utils::{collections::HashSet, errors::ReportSwitchExt};
use error_stack::ResultExt;
use time::PrimitiveDateTime;

Expand Down
4 changes: 1 addition & 3 deletions crates/analytics/src/api_event/metrics/latency.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use std::collections::HashSet;

use api_models::analytics::{
api_event::{ApiEventDimensions, ApiEventFilters, ApiEventMetricsBucketIdentifier},
Granularity, TimeRange,
};
use common_utils::errors::ReportSwitchExt;
use common_utils::{collections::HashSet, errors::ReportSwitchExt};
use error_stack::ResultExt;
use time::PrimitiveDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use std::collections::HashSet;

use api_models::analytics::{
api_event::{ApiEventDimensions, ApiEventFilters, ApiEventMetricsBucketIdentifier},
Granularity, TimeRange,
};
use common_utils::errors::ReportSwitchExt;
use common_utils::{collections::HashSet, errors::ReportSwitchExt};
use error_stack::ResultExt;
use time::PrimitiveDateTime;

Expand Down
4 changes: 1 addition & 3 deletions crates/analytics/src/auth_events/core.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::collections::HashMap;

use api_models::analytics::{
auth_events::{
AuthEventDimensions, AuthEventMetrics, AuthEventMetricsBucketIdentifier,
Expand All @@ -8,7 +6,7 @@ use api_models::analytics::{
AuthEventFilterValue, AuthEventFiltersResponse, AuthEventMetricsResponse,
AuthEventsAnalyticsMetadata, GetAuthEventFilterRequest, GetAuthEventMetricRequest,
};
use common_utils::types::TimeRange;
use common_utils::{collections::HashMap, types::TimeRange};
use error_stack::{report, ResultExt};
use router_env::{instrument, tracing};

Expand Down
3 changes: 1 addition & 2 deletions crates/analytics/src/auth_events/metrics.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use std::collections::HashSet;

use api_models::analytics::{
auth_events::{
AuthEventDimensions, AuthEventFilters, AuthEventMetrics, AuthEventMetricsBucketIdentifier,
},
Granularity, TimeRange,
};
use common_utils::collections::HashSet;
use diesel_models::enums as storage_enums;
use time::PrimitiveDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
use std::collections::HashSet;

use api_models::analytics::{
auth_events::{AuthEventDimensions, AuthEventFilters, AuthEventMetricsBucketIdentifier},
Granularity, TimeRange,
};
use common_enums::AuthenticationStatus;
use common_utils::errors::ReportSwitchExt;
use common_utils::{collections::HashSet, errors::ReportSwitchExt};
use error_stack::ResultExt;
use time::PrimitiveDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use std::collections::HashSet;

use api_models::analytics::{
auth_events::{AuthEventDimensions, AuthEventFilters, AuthEventMetricsBucketIdentifier},
Granularity, TimeRange,
};
use common_utils::errors::ReportSwitchExt;
use common_utils::{collections::HashSet, errors::ReportSwitchExt};
use error_stack::ResultExt;
use time::PrimitiveDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
use std::collections::HashSet;

use api_models::analytics::{
auth_events::{AuthEventDimensions, AuthEventFilters, AuthEventMetricsBucketIdentifier},
Granularity, TimeRange,
};
use common_enums::AuthenticationStatus;
use common_utils::errors::ReportSwitchExt;
use common_utils::{collections::HashSet, errors::ReportSwitchExt};
use error_stack::ResultExt;
use time::PrimitiveDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use std::collections::HashSet;

use api_models::analytics::{
auth_events::{AuthEventDimensions, AuthEventFilters, AuthEventMetricsBucketIdentifier},
Granularity, TimeRange,
};
use common_utils::errors::ReportSwitchExt;
use common_utils::{collections::HashSet, errors::ReportSwitchExt};
use error_stack::ResultExt;
use time::PrimitiveDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use std::collections::HashSet;

use api_models::analytics::{
auth_events::{AuthEventDimensions, AuthEventFilters, AuthEventMetricsBucketIdentifier},
Granularity, TimeRange,
};
use common_utils::errors::ReportSwitchExt;
use common_utils::{collections::HashSet, errors::ReportSwitchExt};
use error_stack::ResultExt;
use time::PrimitiveDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use std::collections::HashSet;

use api_models::analytics::{
auth_events::{AuthEventDimensions, AuthEventFilters, AuthEventMetricsBucketIdentifier},
Granularity, TimeRange,
};
use common_utils::errors::ReportSwitchExt;
use common_utils::{collections::HashSet, errors::ReportSwitchExt};
use error_stack::ResultExt;
use time::PrimitiveDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
use std::collections::HashSet;

use api_models::analytics::{
auth_events::{AuthEventDimensions, AuthEventFilters, AuthEventMetricsBucketIdentifier},
Granularity, TimeRange,
};
use common_enums::AuthenticationStatus;
use common_utils::errors::ReportSwitchExt;
use common_utils::{collections::HashSet, errors::ReportSwitchExt};
use error_stack::ResultExt;
use time::PrimitiveDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
use std::collections::HashSet;

use api_models::analytics::{
auth_events::{AuthEventDimensions, AuthEventFilters, AuthEventMetricsBucketIdentifier},
Granularity, TimeRange,
};
use common_enums::{AuthenticationStatus, DecoupledAuthenticationType};
use common_utils::errors::ReportSwitchExt;
use common_utils::{collections::HashSet, errors::ReportSwitchExt};
use error_stack::ResultExt;
use time::PrimitiveDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
use std::collections::HashSet;

use api_models::analytics::{
auth_events::{AuthEventDimensions, AuthEventFilters, AuthEventMetricsBucketIdentifier},
Granularity, TimeRange,
};
use common_enums::DecoupledAuthenticationType;
use common_utils::errors::ReportSwitchExt;
use common_utils::{collections::HashSet, errors::ReportSwitchExt};
use error_stack::ResultExt;
use time::PrimitiveDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
use std::collections::HashSet;

use api_models::analytics::{
auth_events::{AuthEventDimensions, AuthEventFilters, AuthEventMetricsBucketIdentifier},
Granularity, TimeRange,
};
use common_enums::{AuthenticationStatus, DecoupledAuthenticationType};
use common_utils::errors::ReportSwitchExt;
use common_utils::{collections::HashSet, errors::ReportSwitchExt};
use error_stack::ResultExt;
use time::PrimitiveDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
use std::collections::HashSet;

use api_models::analytics::{
auth_events::{AuthEventDimensions, AuthEventFilters, AuthEventMetricsBucketIdentifier},
Granularity, TimeRange,
};
use common_enums::DecoupledAuthenticationType;
use common_utils::errors::ReportSwitchExt;
use common_utils::{collections::HashSet, errors::ReportSwitchExt};
use error_stack::ResultExt;
use time::PrimitiveDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
use std::collections::HashSet;

use api_models::analytics::{
auth_events::{AuthEventDimensions, AuthEventFilters, AuthEventMetricsBucketIdentifier},
Granularity, TimeRange,
};
use common_enums::{AuthenticationStatus, DecoupledAuthenticationType};
use common_utils::errors::ReportSwitchExt;
use common_utils::{collections::HashSet, errors::ReportSwitchExt};
use error_stack::ResultExt;
use time::PrimitiveDateTime;

Expand Down
3 changes: 1 addition & 2 deletions crates/analytics/src/disputes/core.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::collections::HashMap;

use api_models::analytics::{
disputes::{
DisputeDimensions, DisputeMetrics, DisputeMetricsBucketIdentifier,
Expand All @@ -8,6 +6,7 @@ use api_models::analytics::{
DisputeFilterValue, DisputeFiltersResponse, DisputesAnalyticsMetadata, DisputesMetricsResponse,
GetDisputeFilterRequest, GetDisputeMetricRequest,
};
use common_utils::collections::HashMap;
use error_stack::ResultExt;
use router_env::{
logger,
Expand Down
4 changes: 1 addition & 3 deletions crates/analytics/src/disputes/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ mod sessionized_metrics;
mod total_amount_disputed;
mod total_dispute_lost_amount;

use std::collections::HashSet;

use api_models::analytics::{
disputes::{DisputeDimensions, DisputeFilters, DisputeMetrics, DisputeMetricsBucketIdentifier},
Granularity,
};
use common_utils::types::TimeRange;
use common_utils::{collections::HashSet, types::TimeRange};
use diesel_models::enums as storage_enums;
use time::PrimitiveDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use std::collections::HashSet;

use api_models::analytics::{
disputes::{DisputeDimensions, DisputeFilters, DisputeMetricsBucketIdentifier},
Granularity, TimeRange,
};
use common_utils::errors::ReportSwitchExt;
use common_utils::{collections::HashSet, errors::ReportSwitchExt};
use error_stack::ResultExt;
use time::PrimitiveDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use std::collections::HashSet;

use api_models::analytics::{
disputes::{DisputeDimensions, DisputeFilters, DisputeMetricsBucketIdentifier},
Granularity, TimeRange,
};
use common_utils::errors::ReportSwitchExt;
use common_utils::{collections::HashSet, errors::ReportSwitchExt};
use error_stack::ResultExt;
use time::PrimitiveDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use std::collections::HashSet;

use api_models::analytics::{
disputes::{DisputeDimensions, DisputeFilters, DisputeMetricsBucketIdentifier},
Granularity, TimeRange,
};
use common_utils::errors::ReportSwitchExt;
use common_utils::{collections::HashSet, errors::ReportSwitchExt};
use error_stack::ResultExt;
use time::PrimitiveDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use std::collections::HashSet;

use api_models::analytics::{
disputes::{DisputeDimensions, DisputeFilters, DisputeMetricsBucketIdentifier},
Granularity, TimeRange,
};
use common_utils::errors::ReportSwitchExt;
use common_utils::{collections::HashSet, errors::ReportSwitchExt};
use error_stack::ResultExt;
use time::PrimitiveDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use std::collections::HashSet;

use api_models::analytics::{
disputes::{DisputeDimensions, DisputeFilters, DisputeMetricsBucketIdentifier},
Granularity, TimeRange,
};
use common_utils::errors::ReportSwitchExt;
use common_utils::{collections::HashSet, errors::ReportSwitchExt};
use error_stack::ResultExt;
use time::PrimitiveDateTime;

Expand Down
Loading
Loading