chore: change server timing render to response

"render" is a loaded term than might be thought as the generation
of a full HTML page. While for this phase we only process the status
and the headers.

Changing it to "response" so is not misleading at least. Users can check the
docs for clarification.
This commit is contained in:
steve-chavez
2023-11-28 10:25:25 -05:00
committed by Steve Chavez
parent 3d56f8435d
commit 958339b8d3
3 changed files with 30 additions and 30 deletions
+3 -3
View File
@@ -13,7 +13,7 @@ import Protolude
data ServerMetric =
SMJwt
| SMParse
| SMRender
| SMResp
| SMPlan
| SMTransaction
deriving (Show, Eq, Ord)
@@ -21,7 +21,7 @@ type ServerTimingData = Map ServerMetric (Maybe Double)
-- | Render the Server-Timing header from a ServerTimingData
--
-- >>> renderServerTimingHeader $ Map.fromList [(SMPlan, 0.1), (SMTransaction, 0.2), (SMRender, 0.3), (SMJwt, 0.4)]
-- >>> renderServerTimingHeader $ Map.fromList [(SMPlan, 0.1), (SMTransaction, 0.2), (SMResp, 0.3), (SMJwt, 0.4)]
-- ("Server-Timing","jwt;dur=400000.0, render;dur=300000.0, plan;dur=100000.0, query;dur=200000.0")
renderServerTimingHeader :: ServerTimingData -> HTTP.Header
renderServerTimingHeader timingData =
@@ -31,6 +31,6 @@ renderTiming (metric, time) = maybe "" (\x -> BS.concat [renderMetric metric, BS
where
renderMetric SMPlan = "plan"
renderMetric SMTransaction = "transaction"
renderMetric SMRender = "render"
renderMetric SMResp = "response"
renderMetric SMJwt = "jwt"
renderMetric SMParse = "parse"