text
stringlengths
70
351k
source
stringclasses
4 values
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/opensearch.rs | crate: analytics use api_models::{ analytics::search::SearchIndex, errors::types::{ApiError, ApiErrorResponse}, }; use aws_config::{self, meta::region::RegionProviderChain, Region}; pub fn search_index_to_opensearch_index(&self, index: Sea...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/opensearch.rs | crate: analytics use api_models::{ analytics::search::SearchIndex, errors::types::{ApiError, ApiErrorResponse}, }; use aws_config::{self, meta::region::RegionProviderChain, Region}; pub fn get_amount_field(&self, index: SearchIndex) -> &st...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/opensearch.rs | crate: analytics use api_models::{ analytics::search::SearchIndex, errors::types::{ApiError, ApiErrorResponse}, }; use aws_config::{self, meta::region::RegionProviderChain, Region}; pub fn get_status_field(&self, index: SearchIndex) -> &st...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/opensearch.rs | crate: analytics use aws_config::{self, meta::region::RegionProviderChain, Region}; use serde_json::{json, Map, Value}; use super::{health_check::HealthCheck, query::QueryResult, types::QueryExecutionError}; pub fn add_filter_clause(&mut self, lhs...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/opensearch.rs | crate: analytics use aws_config::{self, meta::region::RegionProviderChain, Region}; use super::{health_check::HealthCheck, query::QueryResult, types::QueryExecutionError}; pub fn set_time_range(&mut self, time_range: OpensearchTimeRange) -> QueryR...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/opensearch.rs | crate: analytics use aws_config::{self, meta::region::RegionProviderChain, Region}; use super::{health_check::HealthCheck, query::QueryResult, types::QueryExecutionError}; pub fn set_offset_n_count(&mut self, offset: i64, count: i64) -> QueryResul...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/opensearch.rs | crate: analytics use std::collections::HashSet; use super::{health_check::HealthCheck, query::QueryResult, types::QueryExecutionError}; use crate::{enums::AuthInfo, query::QueryBuildingError}; pub fn new(query_type: OpenSearchQuery, query: String,...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/opensearch.rs | crate: analytics use aws_config::{self, meta::region::RegionProviderChain, Region}; use storage_impl::errors::{ApplicationError, StorageError, StorageResult}; pub async fn get_opensearch_client(&self) -> StorageResult<Option<OpenSearchClient>> { {...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/opensearch.rs | crate: analytics use api_models::{ analytics::search::SearchIndex, errors::types::{ApiError, ApiErrorResponse}, }; use aws_config::{self, meta::region::RegionProviderChain, Region}; pub fn search_index_to_opensearch_index(&self, index: Sea...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/opensearch.rs | crate: analytics use aws_config::{self, meta::region::RegionProviderChain, Region}; use crate::{enums::AuthInfo, query::QueryBuildingError}; fn switch(&self) -> OpenSearchError { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/opensearch.rs | crate: analytics use common_utils::{ errors::{CustomResult, ErrorSwitch}, types::TimeRange, }; fn from(time_range: TimeRange) -> Self { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/errors.rs | crate: analytics use api_models::errors::types::{ApiError, ApiErrorResponse}; fn switch(&self) -> ApiErrorResponse { { Self::NotImplemented(feature) => ApiErrorResponse::NotImplemented(ApiError::new( "IR", 0, ...
ast_fragments
// file: hyperswitch/crates/analytics/src/errors.rs | crate: analytics use api_models::errors::types::{ApiError, ApiErrorResponse}; fn switch(&self) -> ApiErrorResponse { match self { Self::NotImplemented(feature) => ApiErrorResponse::NotImplemented(ApiError::new( "IR", ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/outgoing_webhook_event/core.rs | crate: analytics use api_models::analytics::outgoing_webhook_event::OutgoingWebhookLogsRequest; use common_utils::errors::ReportSwitchExt; use super::events::{get_outgoing_webhook_event, OutgoingWebhookLogsResult}; use crate::{err...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/outgoing_webhook_event/core.rs | crate: analytics use api_models::analytics::outgoing_webhook_event::OutgoingWebhookLogsRequest; use common_utils::errors::ReportSwitchExt; use super::events::{get_outgoing_webhook_event, OutgoingWebhookLogsResult}; use crate::{err...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/payments/core.rs | crate: analytics total_payment_processed_count: Some(total_payment_processed_count), total_payment_processed_count_without_smart_retries: Some( total_payment_processed_count_without_smart_retries, ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/payments/core.rs | crate: analytics use api_models::analytics::{ payments::{ MetricsBucketResponse, PaymentDimensions, PaymentDistributions, PaymentMetrics, PaymentMetricsBucketIdentifier, }, FilterValue, GetPaymentFiltersRequest, GetP...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/payments/core.rs | crate: analytics use std::collections::{HashMap, HashSet}; use api_models::analytics::{ payments::{ MetricsBucketResponse, PaymentDimensions, PaymentDistributions, PaymentMetrics, PaymentMetricsBucketIdentifier, }, F...
ast_fragments
// file: hyperswitch/crates/analytics/src/payments/filters.rs | crate: analytics use api_models::analytics::{payments::PaymentDimensions, Granularity, TimeRange}; use time::PrimitiveDateTime; use crate::{ enums::AuthInfo, query::{Aggregate, GroupByClause, QueryBuilder, QueryFilter, ToSql, Window}, types::{ ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/payments/filters.rs | crate: analytics use api_models::analytics::{payments::PaymentDimensions, Granularity, TimeRange}; use time::PrimitiveDateTime; use crate::{ enums::AuthInfo, query::{Aggregate, GroupByClause, QueryBuilder, QueryFilter, ToSql, Window}...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/payments/accumulator.rs | crate: analytics use api_models::analytics::payments::{ErrorResult, PaymentMetricsBucketValue}; pub fn collect(self) -> PaymentMetricsBucketValue { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/payments/accumulator.rs | crate: analytics use bigdecimal::ToPrimitive; use router_env::logger; use super::{distribution::PaymentDistributionRow, metrics::PaymentMetricRow}; fn add_metrics_bucket(&mut self, metrics: &PaymentMetricRow) { { (Some(total), Some(count...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/payments/accumulator.rs | crate: analytics use bigdecimal::ToPrimitive; use super::{distribution::PaymentDistributionRow, metrics::PaymentMetricRow}; fn add_metrics_bucket(&mut self, metrics: &PaymentMetricRow) { { (None, None) => None,<|fim_suffix|> <|fim_middle...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/payments/accumulator.rs | crate: analytics use bigdecimal::ToPrimitive; use router_env::logger; use super::{distribution::PaymentDistributionRow, metrics::PaymentMetricRow}; fn add_metrics_bucket(&mut self, metrics: &PaymentMetricRow) { <|fim_suffix|> <|fim_middl...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/payments/accumulator.rs | crate: analytics fn collect(self) -> Self::MetricOutput { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/payments/accumulator.rs | crate: analytics use super::{distribution::PaymentDistributionRow, metrics::PaymentMetricRow}; fn add_distribution_bucket(&mut self, distribution: &PaymentDistributionRow) { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/payments/distribution/payment_error_message.rs | crate: analytics use api_models::analytics::{ payments::{PaymentDimensions, PaymentFilters, PaymentMetricsBucketIdentifier}, Granularity, PaymentDistributionBody, TimeRange, }; use diesel_models::enums as s...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/payments/distribution/payment_error_message.rs | crate: analytics use api_models::analytics::{ payments::{PaymentDimensions, PaymentFilters, PaymentMetricsBucketIdentifier}, Granularity, PaymentDistributionBody, TimeRange, }; use diesel_models::enums as s...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/connector_events/core.rs | crate: analytics use api_models::analytics::connector_events::ConnectorEventsRequest; use common_utils::errors::ReportSwitchExt; use super::events::{get_connector_events, ConnectorEventsResult}; use crate::{errors::AnalyticsResult, type...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/connector_events/core.rs | crate: analytics use api_models::analytics::connector_events::ConnectorEventsRequest; use common_utils::errors::ReportSwitchExt; use super::events::{get_connector_events, ConnectorEventsResult}; use crate::{errors::AnalyticsResult, type...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/api_event/core.rs | crate: analytics use std::collections::HashMap; use api_models::analytics::{ api_event::{ ApiEventMetricsBucketIdentifier, ApiEventMetricsBucketValue, ApiLogsRequest, ApiMetricsBucketResponse, }, AnalyticsMetadata, ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/api_event/core.rs | crate: analytics )) .attach_printable("SQL Analytics is not implemented for API Events"), AnalyticsProvider::Clickhouse(pool) => get_api_event(merchant_id, req, pool).await, AnalyticsProvider::CombinedSqlx(_sqlx...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/api_event/core.rs | crate: analytics use api_models::analytics::{ api_event::{ ApiEventMetricsBucketIdentifier, ApiEventMetricsBucketValue, ApiLogsRequest, ApiMetricsBucketResponse, }, AnalyticsMetadata, ApiEventFiltersResponse, GetApi...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/api_event/core.rs | crate: analytics use api_models::analytics::{ api_event::{ ApiEventMetricsBucketIdentifier, ApiEventMetricsBucketValue, ApiLogsRequest, ApiMetricsBucketResponse, }, AnalyticsMetadata, ApiEventFiltersResponse, GetApi...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/api_event/core.rs | crate: analytics use std::collections::HashMap; use api_models::analytics::{ api_event::{ ApiEventMetricsBucketIdentifier, ApiEventMetricsBucketValue, ApiLogsRequest, ApiMetricsBucketResponse, }, AnalyticsMetadata, ...
ast_fragments
// file: hyperswitch/crates/analytics/src/api_event/filters.rs | crate: analytics use api_models::analytics::{api_event::ApiEventDimensions, Granularity, TimeRange}; use common_utils::errors::ReportSwitchExt; use time::PrimitiveDateTime; use crate::{ query::{Aggregate, GroupByClause, QueryBuilder, QueryFilter, ToSq...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/api_event/filters.rs | crate: analytics use api_models::analytics::{api_event::ApiEventDimensions, Granularity, TimeRange}; use common_utils::errors::ReportSwitchExt; use time::PrimitiveDateTime; use crate::{ query::{Aggregate, GroupByClause, QueryBuilder, Qu...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/api_event/metrics/api_count.rs | crate: analytics use std::collections::HashSet; use api_models::analytics::{ api_event::{ApiEventDimensions, ApiEventFilters, ApiEventMetricsBucketIdentifier}, Granularity, TimeRange, }; use common_utils::errors::ReportSwi...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/api_event/metrics/api_count.rs | crate: analytics use std::collections::HashSet; use api_models::analytics::{ api_event::{ApiEventDimensions, ApiEventFilters, ApiEventMetricsBucketIdentifier}, Granularity, TimeRange, }; use common_utils::errors::ReportSwi...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/payment_intents/core.rs | crate: analytics Some(total_payment_processed_amount_without_smart_retries_in_usd) } else { None }, total_payment_processed_count: Some(total_payment_processed_count), ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/payment_intents/core.rs | crate: analytics AnalyticsProvider::Clickhouse(ckh_pool) | AnalyticsProvider::CombinedCkh(_, ckh_pool) | AnalyticsProvider::CombinedSqlx(_, ckh_pool) => { let sankey_rows = get_sankey_data(ckh_pool, au...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/payment_intents/core.rs | crate: analytics use common_utils::{errors::CustomResult, types::TimeRange}; use super::{ filters::{get_payment_intent_filter_for_dimension, PaymentIntentFilterRow}, metrics::PaymentIntentMetricRow, sankey::{get_sankey_data, ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/payment_intents/core.rs | crate: analytics use api_models::analytics::{ payment_intents::{ MetricsBucketResponse, PaymentIntentDimensions, PaymentIntentMetrics, PaymentIntentMetricsBucketIdentifier, }, GetPaymentIntentFiltersRequest, G...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/payment_intents/core.rs | crate: analytics use std::collections::{HashMap, HashSet}; use api_models::analytics::{ payment_intents::{ MetricsBucketResponse, PaymentIntentDimensions, PaymentIntentMetrics, PaymentIntentMetricsBucketIdentifier, ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/payment_intents/accumulator.rs | crate: analytics use api_models::analytics::payment_intents::PaymentIntentMetricsBucketValue; pub fn collect(self) -> PaymentIntentMetricsBucketValue { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/payment_intents/accumulator.rs | crate: analytics use diesel_models::enums as storage_enums; use super::metrics::PaymentIntentMetricRow; fn add_metrics_bucket(&mut self, metrics: &PaymentIntentMetricRow) { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/payment_intents/accumulator.rs | crate: analytics fn collect(self) -> Self::MetricOutput { { (Some(s), Some(t)) if t > 0 => Some(f64::from(s) * 100.0 / f64::from(t)),<|fim_suffix|> <|fim_middle|> _ => None, } }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/payment_intents/metrics/payment_intent_count.rs | crate: analytics use std::collections::HashSet; use api_models::analytics::{ payment_intents::{ PaymentIntentDimensions, PaymentIntentFilters, PaymentIntentMetricsBucketIdentifier, }, Granulari...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/active_payments/accumulator.rs | crate: analytics use super::metrics::ActivePaymentsMetricRow; fn add_metrics_bucket(&mut self, metrics: &ActivePaymentsMetricRow) { { (None, None) => None,<|fim_suffix|> <|fim_middle|> (Some(a), Some(b)) => Some(a + b), } }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/active_payments/accumulator.rs | crate: analytics use api_models::analytics::active_payments::ActivePaymentsMetricsBucketValue; pub fn collect(self) -> ActivePaymentsMetricsBucketValue { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/active_payments/accumulator.rs | crate: analytics use super::metrics::ActivePaymentsMetricRow; fn add_metrics_bucket(&mut self, metrics: &ActivePaymentsMetricRow) { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/sdk_events/core.rs | crate: analytics use std::collections::HashMap; use api_models::analytics::{ sdk_events::{ MetricsBucketResponse, SdkEventMetrics, SdkEventMetricsBucketIdentifier, SdkEventsRequest, }, AnalyticsMetadata, GetSdkEventFilters...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/sdk_events/core.rs | crate: analytics }) .collect(); Ok(MetricsResponse { query_data, meta_data: [AnalyticsMetadata { current_time_range: req.time_range, }], }) } #[allow(dead_code)] pub async fn get_f...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/sdk_events/core.rs | crate: analytics use api_models::analytics::{ sdk_events::{ MetricsBucketResponse, SdkEventMetrics, SdkEventMetricsBucketIdentifier, SdkEventsRequest, }, AnalyticsMetadata, GetSdkEventFiltersRequest, GetSdkEventMetricReque...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/sdk_events/core.rs | crate: analytics use api_models::analytics::{ sdk_events::{ MetricsBucketResponse, SdkEventMetrics, SdkEventMetricsBucketIdentifier, SdkEventsRequest, }, AnalyticsMetadata, GetSdkEventFiltersRequest, GetSdkEventMetricReque...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/sdk_events/core.rs | crate: analytics use std::collections::HashMap; use api_models::analytics::{ sdk_events::{ MetricsBucketResponse, SdkEventMetrics, SdkEventMetricsBucketIdentifier, SdkEventsRequest, }, AnalyticsMetadata, GetSdkEventFilters...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/sdk_events/accumulator.rs | crate: analytics use router_env::logger; use super::metrics::SdkEventMetricRow; fn add_metrics_bucket(&mut self, metrics: &SdkEventMetricRow) { { (Some(total), Some(count)) => { self.total += total; self...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/sdk_events/accumulator.rs | crate: analytics use api_models::analytics::sdk_events::SdkEventMetricsBucketValue; pub fn collect(self) -> SdkEventMetricsBucketValue { <|fim_suffix|> <|fim_middle|> }
ast_fragments
// file: hyperswitch/crates/analytics/src/sdk_events/accumulator.rs | crate: analytics fn collect(self) -> Self::MetricOutput { if self.count == 0 { None } else { Some(f64::from(self.total) / f64::from(self.count)) } }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/sdk_events/accumulator.rs | crate: analytics use router_env::logger; use super::metrics::SdkEventMetricRow; fn add_metrics_bucket(&mut self, metrics: &SdkEventMetricRow) { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/disputes/metrics.rs | crate: analytics use std::collections::HashSet; use api_models::analytics::{ disputes::{DisputeDimensions, DisputeFilters, DisputeMetrics, DisputeMetricsBucketIdentifier}, Granularity, }; use common_utils::types::TimeRange; use self:...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/disputes/metrics.rs | crate: analytics use std::collections::HashSet; use api_models::analytics::{ disputes::{DisputeDimensions, DisputeFilters, DisputeMetrics, DisputeMetricsBucketIdentifier}, Granularity, }; use common_utils::types::TimeRange; use self:...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/disputes/accumulators.rs | crate: analytics use api_models::analytics::disputes::DisputeMetricsBucketValue; pub fn collect(self) -> DisputeMetricsBucketValue { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/disputes/accumulators.rs | crate: analytics use super::metrics::DisputeMetricRow; fn add_metrics_bucket(&mut self, metrics: &DisputeMetricRow) { { (None, None) => None,<|fim_suffix|> <|fim_middle|> (Some(a), Some(b)) => Some(a + b), } }
ast_fragments
// file: hyperswitch/crates/analytics/src/disputes/accumulators.rs | crate: analytics use api_models::analytics::disputes::DisputeMetricsBucketValue; pub fn collect(self) -> DisputeMetricsBucketValue { let (challenge_rate, won_rate, lost_rate, total_dispute) = self.disputes_status_rate.collect().unw...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/disputes/accumulators.rs | crate: analytics use diesel_models::enums as storage_enums; use super::metrics::DisputeMetricRow; fn add_metrics_bucket(&mut self, metrics: &DisputeMetricRow) { <|fim_suffix|> <|fim_middle|> }
ast_fragments
// file: hyperswitch/crates/analytics/src/disputes/accumulators.rs | crate: analytics fn collect(self) -> Self::MetricOutput { self.total.and_then(|i| u64::try_from(i).ok()) }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/disputes/metrics/total_dispute_lost_amount.rs | crate: analytics use std::collections::HashSet; use api_models::analytics::{ disputes::{DisputeDimensions, DisputeFilters, DisputeMetricsBucketIdentifier}, Granularity, TimeRange, }; use error_stack::ResultE...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/disputes/metrics/total_dispute_lost_amount.rs | crate: analytics use std::collections::HashSet; use api_models::analytics::{ disputes::{DisputeDimensions, DisputeFilters, DisputeMetricsBucketIdentifier}, Granularity, TimeRange, }; use error_stack::ResultE...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/frm/core.rs | crate: analytics use api_models::analytics::{ frm::{FrmDimensions, FrmMetrics, FrmMetricsBucketIdentifier, FrmMetricsBucketResponse}, AnalyticsMetadata, FrmFilterValue, FrmFiltersResponse, GetFrmFilterRequest, GetFrmMetricRequest, Metric...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/frm/core.rs | crate: analytics use api_models::analytics::{ frm::{FrmDimensions, FrmMetrics, FrmMetricsBucketIdentifier, FrmMetricsBucketResponse}, AnalyticsMetadata, FrmFilterValue, FrmFiltersResponse, GetFrmFilterRequest, GetFrmMetricRequest, Metric...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/frm/core.rs | crate: analytics use std::collections::HashMap; use api_models::analytics::{ frm::{FrmDimensions, FrmMetrics, FrmMetricsBucketIdentifier, FrmMetricsBucketResponse}, AnalyticsMetadata, FrmFilterValue, FrmFiltersResponse, GetFrmFilterRequest, ...
ast_fragments
// file: hyperswitch/crates/analytics/src/frm/filters.rs | crate: analytics use api_models::analytics::{ frm::{FrmDimensions, FrmTransactionType}, Granularity, TimeRange, }; use common_utils::errors::ReportSwitchExt; use time::PrimitiveDateTime; use crate::{ query::{Aggregate, GroupByClause, QueryBuilder, Q...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/frm/filters.rs | crate: analytics use api_models::analytics::{ frm::{FrmDimensions, FrmTransactionType}, Granularity, TimeRange, }; use common_utils::errors::ReportSwitchExt; use time::PrimitiveDateTime; use crate::{ query::{Aggregate, GroupByClause, ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/frm/accumulator.rs | crate: analytics use super::metrics::FrmMetricRow; fn add_metrics_bucket(&mut self, metrics: &FrmMetricRow) { { (None, None) => None,<|fim_suffix|> <|fim_middle|> (Some(a), Some(b)) => Some(a + b), } }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/frm/accumulator.rs | crate: analytics use api_models::analytics::frm::FrmMetricsBucketValue; pub fn collect(self) -> FrmMetricsBucketValue { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/frm/accumulator.rs | crate: analytics use common_enums::enums as storage_enums; use super::metrics::FrmMetricRow; fn add_metrics_bucket(&mut self, metrics: &FrmMetricRow) { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/auth_events/core.rs | crate: analytics use api_models::analytics::{ auth_events::{ AuthEventDimensions, AuthEventMetrics, AuthEventMetricsBucketIdentifier, MetricsBucketResponse, }, AuthEventFilterValue, AuthEventFiltersResponse, AuthE...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/auth_events/core.rs | crate: analytics use api_models::analytics::{ auth_events::{ AuthEventDimensions, AuthEventMetrics, AuthEventMetricsBucketIdentifier, MetricsBucketResponse, }, AuthEventFilterValue, AuthEventFiltersResponse, AuthE...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/auth_events/core.rs | crate: analytics use std::collections::HashMap; use api_models::analytics::{ auth_events::{ AuthEventDimensions, AuthEventMetrics, AuthEventMetricsBucketIdentifier, MetricsBucketResponse, }, AuthEventFilterValue, ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/auth_events/accumulator.rs | crate: analytics use super::metrics::AuthEventMetricRow; fn add_metrics_bucket(&mut self, metrics: &AuthEventMetricRow) { { (None, None) => None,<|fim_suffix|> <|fim_middle|> (Some(a), Some(b)) => Some(a + b), } }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/auth_events/accumulator.rs | crate: analytics use api_models::analytics::auth_events::AuthEventMetricsBucketValue; pub fn collect(self) -> AuthEventMetricsBucketValue { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/auth_events/accumulator.rs | crate: analytics use super::metrics::AuthEventMetricRow; fn add_metrics_bucket(&mut self, metrics: &AuthEventMetricRow) { <|fim_suffix|> <|fim_middle|> }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/refunds/core.rs | crate: analytics #[derive(Debug)] pub enum TaskType { MetricTask( RefundMetrics, CustomResult<HashSet<(RefundMetricsBucketIdentifier, RefundMetricRow)>, AnalyticsError>, ), DistributionTask( RefundDistribution...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/refunds/core.rs | crate: analytics use api_models::analytics::{ refunds::{ RefundDimensions, RefundDistributions, RefundMetrics, RefundMetricsBucketIdentifier, RefundMetricsBucketResponse, }, GetRefundFilterRequest, GetRefundMetricRequ...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/refunds/core.rs | crate: analytics use std::collections::{HashMap, HashSet}; use api_models::analytics::{ refunds::{ RefundDimensions, RefundDistributions, RefundMetrics, RefundMetricsBucketIdentifier, RefundMetricsBucketResponse, }, G...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/refunds/metrics.rs | crate: analytics use api_models::analytics::{ refunds::{ RefundDimensions, RefundFilters, RefundMetrics, RefundMetricsBucketIdentifier, RefundType, }, Granularity, TimeRange, }; use std::collections::HashSet; use refund_co...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/refunds/accumulator.rs | crate: analytics use super::{distribution::RefundDistributionRow, metrics::RefundMetricRow}; fn add_metrics_bucket(&mut self, metrics: &RefundMetricRow) { { (None, None) => None,<|fim_suffix|> <|fim_middle|> (Some(a), Some(b)) => Some(a +...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/refunds/accumulator.rs | crate: analytics use api_models::analytics::refunds::{ ErrorMessagesResult, ReasonsResult, RefundMetricsBucketValue, }; pub fn collect(self) -> RefundMetricsBucketValue { <|fim_suffix|> <|fim_middle|> }
ast_fragments
// file: hyperswitch/crates/analytics/src/refunds/accumulator.rs | crate: analytics fn collect(self) -> Self::MetricOutput { Some(self.count) }
ast_fragments
// file: hyperswitch/crates/analytics/src/refunds/accumulator.rs | crate: analytics fn collect(self) -> Self::MetricOutput { let total = u64::try_from(self.total.unwrap_or_default()).ok(); let count = self.count.and_then(|i| u64::try_from(i).ok()); (total, count, Some(0)) }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/refunds/accumulator.rs | crate: analytics use bigdecimal::ToPrimitive; use super::{distribution::RefundDistributionRow, metrics::RefundMetricRow}; fn add_metrics_bucket(&mut self, metrics: &RefundMetricRow) { <|fim_suffix|> <|fim_middle|> }
ast_fragments
// file: hyperswitch/crates/analytics/src/refunds/accumulator.rs | crate: analytics fn collect(self) -> Self::MetricOutput { self.count.and_then(|i| u64::try_from(i).ok()) }
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/refunds/accumulator.rs | crate: analytics use super::{distribution::RefundDistributionRow, metrics::RefundMetricRow}; fn add_distribution_bucket(&mut self, distribution: &RefundDistributionRow) { {<|fim_suffix|> <|fim_middle|> }}
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/refunds/accumulator.rs | crate: analytics use api_models::analytics::refunds::{ ErrorMessagesResult, ReasonsResult, RefundMetricsBucketValue, }; fn collect(mut self) -> Self::DistributionOutput { <|fim_suffix|> <|fim_middle|> }
ast_fragments
// file: hyperswitch/crates/analytics/src/refunds/accumulator.rs | crate: analytics use super::{distribution::RefundDistributionRow, metrics::RefundMetricRow}; fn add_distribution_bucket(&mut self, distribution: &RefundDistributionRow) { self.refund_reason_vec.push(RefundReasonDistributionRow { coun...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/refunds/metrics/refund_processed_amount.rs | crate: analytics use std::collections::HashSet; use api_models::analytics::{ refunds::{RefundDimensions, RefundFilters, RefundMetricsBucketIdentifier}, Granularity, TimeRange, }; use diesel_models::enums as sto...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/analytics/src/refunds/metrics/refund_processed_amount.rs | crate: analytics use std::collections::HashSet; use api_models::analytics::{ refunds::{RefundDimensions, RefundFilters, RefundMetricsBucketIdentifier}, Granularity, TimeRange, }; use diesel_models::enums as sto...
ast_fragments
// file: hyperswitch/crates/hyperswitch_interfaces/src/webhooks.rs | crate: hyperswitch_interfaces use common_utils::{crypto, errors::CustomResult, ext_traits::ValueExt}; use hyperswitch_domain_models::{ api::ApplicationResponse, errors::api_error_response::ApiErrorResponse, }; use masking::{ExposeInterface, Secret...
ast_fragments
<|fim_prefix|> // file: hyperswitch/crates/hyperswitch_interfaces/src/webhooks.rs | crate: hyperswitch_interfaces use common_utils::{crypto, errors::CustomResult, ext_traits::ValueExt}; use hyperswitch_domain_models::{ api::ApplicationResponse, errors::api_error_response::ApiErrorResponse, }; use crate::{api::Conne...
ast_fragments