1- use axum:: {
2- extract:: State ,
3- response:: IntoResponse ,
4- } ;
1+ use axum:: response:: IntoResponse ;
52use common:: {
63 components:: {
74 ComponentFunctionPath ,
@@ -10,6 +7,7 @@ use common::{
107 http:: {
118 extract:: {
129 Json ,
10+ MtState ,
1311 Query ,
1412 } ,
1513 HttpResponseError ,
@@ -39,7 +37,7 @@ pub(crate) struct UdfRateQueryArgs {
3937}
4038
4139pub ( crate ) async fn udf_rate (
42- State ( st) : State < LocalAppState > ,
40+ MtState ( st) : MtState < LocalAppState > ,
4341 ExtractIdentity ( identity) : ExtractIdentity ,
4442 Query ( UdfRateQueryArgs {
4543 component_path,
@@ -69,7 +67,7 @@ pub(crate) struct TopKQueryArgs {
6967}
7068
7169pub ( crate ) async fn failure_percentage_top_k (
72- State ( st) : State < LocalAppState > ,
70+ MtState ( st) : MtState < LocalAppState > ,
7371 ExtractIdentity ( identity) : ExtractIdentity ,
7472 Query ( TopKQueryArgs { window, k } ) : Query < TopKQueryArgs > ,
7573) -> Result < impl IntoResponse , HttpResponseError > {
@@ -85,7 +83,7 @@ pub(crate) async fn failure_percentage_top_k(
8583}
8684
8785pub ( crate ) async fn cache_hit_percentage_top_k (
88- State ( st) : State < LocalAppState > ,
86+ MtState ( st) : MtState < LocalAppState > ,
8987 ExtractIdentity ( identity) : ExtractIdentity ,
9088 Query ( TopKQueryArgs { window, k } ) : Query < TopKQueryArgs > ,
9189) -> Result < impl IntoResponse , HttpResponseError > {
@@ -110,7 +108,7 @@ pub(crate) struct CacheHitPercentageQueryArgs {
110108 udf_type : Option < String > ,
111109}
112110pub ( crate ) async fn cache_hit_percentage (
113- State ( st) : State < LocalAppState > ,
111+ MtState ( st) : MtState < LocalAppState > ,
114112 ExtractIdentity ( identity) : ExtractIdentity ,
115113 Query ( query_args) : Query < CacheHitPercentageQueryArgs > ,
116114) -> Result < impl IntoResponse , HttpResponseError > {
@@ -140,7 +138,7 @@ pub(crate) struct LatencyPercentilesQueryArgs {
140138 udf_type : Option < String > ,
141139}
142140pub ( crate ) async fn latency_percentiles (
143- State ( st) : State < LocalAppState > ,
141+ MtState ( st) : MtState < LocalAppState > ,
144142 ExtractIdentity ( identity) : ExtractIdentity ,
145143 Query ( query_args) : Query < LatencyPercentilesQueryArgs > ,
146144) -> Result < impl IntoResponse , HttpResponseError > {
@@ -170,7 +168,7 @@ pub(crate) struct TableRateQueryArgs {
170168 window : String ,
171169}
172170pub ( crate ) async fn table_rate (
173- State ( st) : State < LocalAppState > ,
171+ MtState ( st) : MtState < LocalAppState > ,
174172 ExtractIdentity ( identity) : ExtractIdentity ,
175173 Query ( query_args) : Query < TableRateQueryArgs > ,
176174) -> Result < impl IntoResponse , HttpResponseError > {
@@ -224,7 +222,7 @@ pub(crate) struct ScheduledJobLagArgs {
224222 window : String ,
225223}
226224pub ( crate ) async fn scheduled_job_lag (
227- State ( st) : State < LocalAppState > ,
225+ MtState ( st) : MtState < LocalAppState > ,
228226 ExtractIdentity ( identity) : ExtractIdentity ,
229227 Query ( query_args) : Query < ScheduledJobLagArgs > ,
230228) -> Result < impl IntoResponse , HttpResponseError > {
0 commit comments