feat: add Server-Timing header with JWT duration
This commit is contained in:
committed by
Steve Chavez
parent
fa182c216e
commit
c195eece65
@@ -58,6 +58,12 @@ matchHeaderAbsent name = MatchHeader $ \headers _body ->
|
||||
Just _ -> Just $ "unexpected header: " <> toS (original name) <> "\n"
|
||||
Nothing -> Nothing
|
||||
|
||||
matchHeaderPresent :: HeaderName -> MatchHeader
|
||||
matchHeaderPresent name = MatchHeader $ \headers _body ->
|
||||
case lookup name headers of
|
||||
Just _ -> Nothing
|
||||
Nothing -> Just $ "missing header: " <> toS (original name) <> "\n"
|
||||
|
||||
validateOpenApiResponse :: [Header] -> WaiSession () ()
|
||||
validateOpenApiResponse headers = do
|
||||
r <- request methodGet "/" headers ""
|
||||
@@ -226,6 +232,9 @@ testPgSafeUpdateEnabledCfg = baseCfg { configDbPreRequest = Just $ QualifiedIden
|
||||
testObservabilityCfg :: AppConfig
|
||||
testObservabilityCfg = baseCfg { configServerTraceHeader = Just $ mk "X-Request-Id" }
|
||||
|
||||
testCfgServerTiming :: AppConfig
|
||||
testCfgServerTiming = baseCfg { configDbPlanEnabled = True }
|
||||
|
||||
analyzeTable :: Text -> IO ()
|
||||
analyzeTable tableName =
|
||||
void $ readProcess "psql" ["-U", "postgres", "--set", "ON_ERROR_STOP=1", "-a", "-c", toS $ "ANALYZE test.\"" <> tableName <> "\""] []
|
||||
|
||||
Reference in New Issue
Block a user