diff --git a/src/Semantic/Task.hs b/src/Semantic/Task.hs index 63946939b..2a52c803e 100644 --- a/src/Semantic/Task.hs +++ b/src/Semantic/Task.hs @@ -92,12 +92,6 @@ readBlobPairs = send . ReadBlobPairs writeToOutput :: Member TaskF effs => Either Handle FilePath -> B.ByteString -> Eff effs () writeToOutput path = send . WriteToOutput path --- | A task which measures and stats the timing of another task. -time :: Members '[Telemetry, IO] effs => String -> [(String, String)] -> Eff effs output -> Eff effs output -time statName tags task = do - (a, stat) <- withTiming statName tags task - a <$ writeStat stat - -- | A task which parses a 'Blob' with the given 'Parser'. parse :: Member TaskF effs => Parser term -> Blob -> Eff effs term parse parser = send . Parse parser diff --git a/src/Semantic/Telemetry.hs b/src/Semantic/Telemetry.hs index 2a4670bb6..a35b7b6a3 100644 --- a/src/Semantic/Telemetry.hs +++ b/src/Semantic/Telemetry.hs @@ -21,6 +21,12 @@ writeLog level message pairs = send (WriteLog level message pairs) writeStat :: Member Telemetry effs => Stat -> Eff effs () writeStat stat = send (WriteStat stat) +-- | A task which measures and stats the timing of another task. +time :: Members '[Telemetry, IO] effs => String -> [(String, String)] -> Eff effs output -> Eff effs output +time statName tags task = do + (a, stat) <- withTiming statName tags task + a <$ writeStat stat + -- | A queue for logging. type LogQueue = AsyncQueue Message Options