Skip to content

Commit 80e8622

Browse files
committed
Fix mem stats
We parse maxResidency and allocatedBytes from the RTS -S output, but runSessionWithHandles kills the server without waiting for it to exit and these stats don't get logged. The solution is to use runSessionWithHandles', but unfortunately it is internal and not exposed. I have raised a PR to expose it and in the meantime we need a source repo package.
1 parent 084e1be commit 80e8622

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

cabal.project

+8
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ source-repository-package
6565
tag: 7a0af7a8fd38045fd15fb13445bdcc7085325460
6666
-- https://github.com/tibbe/ekg-json/pull/12
6767

68+
-- Needed for ghcide-bench until a new release of lsp-test is out
69+
source-repository-package
70+
type:git
71+
location: https://github.com/haskell/lsp
72+
subdir: lsp-test
73+
tag: c95eb06c70c35f1e13c37ed11a7d9e5b36bfa2e8
74+
-- https://github.com/haskell/lsp/pull/450
75+
6876
allow-newer:
6977
-- ghc-9.2
7078
----------

ghcide-bench/src/Experiments.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -346,15 +346,15 @@ runBenchmarksFun dir allBenchmarks = do
346346
results <- forM benchmarks $ \b@Bench{name} -> do
347347
let p = (proc (ghcide ?config) (allArgs name dir))
348348
{ std_in = CreatePipe, std_out = CreatePipe, std_err = CreatePipe }
349-
run sess = withCreateProcess p $ \(Just inH) (Just outH) (Just errH) _pH -> do
349+
run sess = withCreateProcess p $ \(Just inH) (Just outH) (Just errH) pH -> do
350350
-- Need to continuously consume to stderr else it gets blocked
351351
-- Can't pass NoStream either to std_err
352352
hSetBuffering errH NoBuffering
353353
hSetBinaryMode errH True
354354
let errSinkThread =
355355
forever $ hGetLine errH >>= when (verbose ?config). putStrLn
356356
withAsync errSinkThread $ \_ -> do
357-
runSessionWithHandles inH outH conf lspTestCaps dir sess
357+
runSessionWithHandles' (Just pH) inH outH conf lspTestCaps dir sess
358358
(b,) <$> runBench run b
359359

360360
-- output raw data as CSV

0 commit comments

Comments
 (0)