Skip to content

Commit

Permalink
fix: renamed authentication metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrishab Srivatsa committed May 23, 2024
1 parent 25656f7 commit b061ec4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 29 deletions.
2 changes: 1 addition & 1 deletion config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ primary_color="#006DF9"
primary_hover_color="#005ED6"
sidebar_color="#242F48"
[default.endpoints]
api_url="http://localhost:8080"
api_url="https://sandbox.hyperswitch.io"
sdk_url=""
logo_url=""
favicon_url=""
Expand Down
12 changes: 6 additions & 6 deletions src/screens/Analytics/AnalyticsTypes.res
Original file line number Diff line number Diff line change
Expand Up @@ -232,21 +232,21 @@ type authenticationSingleStat = {
authentication_success_count: int,
authentication_attempt_count: int,
challenge_flow_count: int,
challenge_flow_attempt_count: int,
challenge_flow_success_count: int,
challenge_attempt_count: int,
challenge_success_count: int,
frictionless_flow_count: int,
frictionless_flow_success_count: int,
frictionless_success_count: int,
}

type authenticationSingleStatSeries = {
three_ds_sdk_count: int,
authentication_success_count: int,
authentication_attempt_count: int,
challenge_flow_count: int,
challenge_flow_attempt_count: int,
challenge_flow_success_count: int,
challenge_attempt_count: int,
challenge_success_count: int,
frictionless_flow_count: int,
frictionless_flow_success_count: int,
frictionless_success_count: int,
time_series: string,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ let singleStatInitialValue = {
authentication_success_count: 0,
authentication_attempt_count: 0,
challenge_flow_count: 0,
challenge_flow_attempt_count: 0,
challenge_flow_success_count: 0,
challenge_attempt_count: 0,
challenge_success_count: 0,
frictionless_flow_count: 0,
frictionless_flow_success_count: 0,
frictionless_success_count: 0,
}

let singleStatSeriesInitialValue = {
three_ds_sdk_count: 0,
authentication_success_count: 0,
authentication_attempt_count: 0,
challenge_flow_count: 0,
challenge_flow_attempt_count: 0,
challenge_flow_success_count: 0,
challenge_attempt_count: 0,
challenge_success_count: 0,
frictionless_flow_count: 0,
frictionless_flow_success_count: 0,
frictionless_success_count: 0,
time_series: "",
}

Expand All @@ -36,10 +36,10 @@ let singleStatItemToObjMapper = json => {
authentication_success_count: dict->getInt("authentication_success_count", 0),
authentication_attempt_count: dict->getInt("authentication_attempt_count", 0),
challenge_flow_count: dict->getInt("challenge_flow_count", 0),
challenge_flow_attempt_count: dict->getInt("challenge_flow_attempt_count", 0),
challenge_flow_success_count: dict->getInt("challenge_flow_success_count", 0),
challenge_attempt_count: dict->getInt("challenge_attempt_count", 0),
challenge_success_count: dict->getInt("challenge_success_count", 0),
frictionless_flow_count: dict->getInt("frictionless_flow_count", 0),
frictionless_flow_success_count: dict->getInt("frictionless_flow_success_count", 0),
frictionless_success_count: dict->getInt("frictionless_success_count", 0),
})
->Option.getOr({
singleStatInitialValue
Expand All @@ -55,10 +55,10 @@ let singleStatSeriesItemToObjMapper = json => {
authentication_success_count: dict->getInt("authentication_success_count", 0),
authentication_attempt_count: dict->getInt("authentication_attempt_count", 0),
challenge_flow_count: dict->getInt("challenge_flow_count", 0),
challenge_flow_attempt_count: dict->getInt("challenge_flow_attempt_count", 0),
challenge_flow_success_count: dict->getInt("challenge_flow_success_count", 0),
challenge_attempt_count: dict->getInt("challenge_attempt_count", 0),
challenge_success_count: dict->getInt("challenge_success_count", 0),
frictionless_flow_count: dict->getInt("frictionless_flow_count", 0),
frictionless_flow_success_count: dict->getInt("frictionless_flow_success_count", 0),
frictionless_success_count: dict->getInt("frictionless_success_count", 0),
})
->Option.getOr({
singleStatSeriesInitialValue
Expand Down Expand Up @@ -146,25 +146,21 @@ let constructData = (key, singlestatTimeseriesData: array<authenticationSingleSt
singlestatTimeseriesData->Array.map(ob => {
(
ob.time_series->DateTimeUtils.parseAsFloat,
ob.challenge_flow_attempt_count->Int.toFloat *.
100. /.
ob.challenge_flow_count->Int.toFloat,
ob.challenge_attempt_count->Int.toFloat *. 100. /. ob.challenge_flow_count->Int.toFloat,
)
})
| ChallengeSuccessRate =>
singlestatTimeseriesData->Array.map(ob => {
(
ob.time_series->DateTimeUtils.parseAsFloat,
ob.challenge_flow_success_count->Int.toFloat *.
100. /.
ob.challenge_flow_count->Int.toFloat,
ob.challenge_success_count->Int.toFloat *. 100. /. ob.challenge_flow_count->Int.toFloat,
)
})
| FrictionlessSuccessRate =>
singlestatTimeseriesData->Array.map(ob => {
(
ob.time_series->DateTimeUtils.parseAsFloat,
ob.frictionless_flow_success_count->Int.toFloat *.
ob.frictionless_success_count->Int.toFloat *.
100. /.
ob.frictionless_flow_count->Int.toFloat,
)
Expand Down Expand Up @@ -230,7 +226,7 @@ let getStatData = (
title: "Challenge Attempt Rate",
tooltipText: "Percentage of payments where user attempted the challenge.",
deltaTooltipComponent: _ => React.null,
value: singleStatData.challenge_flow_attempt_count->Int.toFloat *.
value: singleStatData.challenge_attempt_count->Int.toFloat *.
100. /.
singleStatData.challenge_flow_count->Int.toFloat,
delta: 0.0,
Expand All @@ -242,7 +238,7 @@ let getStatData = (
title: "Challenge Success Rate",
tooltipText: "Total number of payments authenticated where user successfully attempted the challenge over the total number of payments requiring a challenge to be passed.",
deltaTooltipComponent: _ => React.null,
value: singleStatData.challenge_flow_success_count->Int.toFloat *.
value: singleStatData.challenge_success_count->Int.toFloat *.
100. /.
singleStatData.challenge_flow_count->Int.toFloat,
delta: 0.0,
Expand All @@ -254,7 +250,7 @@ let getStatData = (
title: "Frictionless Success Rate",
tooltipText: "Total number of payments authenticated over a frictionless flow successfully over the total number of payments going through a frictionless flow.",
deltaTooltipComponent: _ => React.null,
value: singleStatData.challenge_flow_success_count->Int.toFloat *.
value: singleStatData.challenge_success_count->Int.toFloat *.
100. /.
singleStatData.challenge_flow_count->Int.toFloat,
delta: 0.0,
Expand Down

0 comments on commit b061ec4

Please sign in to comment.