Skip to content

Commit 334b4d4

Browse files
authored
Remove EKG (#4163)
It's always been a pain and it's not really used. Fixes #3993
1 parent 1dd54a5 commit 334b4d4

File tree

8 files changed

+2
-112
lines changed

8 files changed

+2
-112
lines changed

bench/Main.hs

-2
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,6 @@ buildHls Cabal root out = actionBracket
202202
liftIO $ writeFile projectLocal $ unlines
203203
["package haskell-language-server"
204204
," ghc-options: -eventlog -rtsopts"
205-
,"package ghcide"
206-
," flags: +ekg"
207205
]
208206
return projectLocalExists)
209207
(\projectLocalExists -> do

cabal.project

-29
Original file line numberDiff line numberDiff line change
@@ -42,32 +42,3 @@ constraints:
4242
-- We want to be able to benefit from the performance optimisations
4343
-- in the future, thus: TODO: remove this flag.
4444
bitvec -simd
45-
46-
-- This is benign and won't affect our ability to release to Hackage,
47-
-- because we only depend on `ekg-json` when a non-default flag
48-
-- is turned on.
49-
-- DELETE MARKER FOR CI
50-
-- centos7 has an old version of git which cabal doesn't
51-
-- support. We delete these lines in gitlab ci to workaround
52-
-- this issue, as this is not necessary to build our binaries.
53-
source-repository-package
54-
type:git
55-
location: https://github.com/pepeiborra/ekg-json
56-
tag: 7a0af7a8fd38045fd15fb13445bdcc7085325460
57-
-- END DELETE
58-
59-
if impl(ghc >= 9.1)
60-
-- ekg packagess are old and unmaintained, but we
61-
-- don't rely on them for the mainline build, so
62-
-- this is okay
63-
allow-newer:
64-
ekg-json:base,
65-
ekg-wai:time,
66-
ekg-core:ghc-prim
67-
68-
if impl(ghc >= 9.7)
69-
-- ekg packagess are old and unmaintained, but we
70-
-- don't rely on them for the mainline build, so
71-
-- this is okay
72-
allow-newer:
73-
ekg-core:text,

docs/contributing/contributing.md

-11
Original file line numberDiff line numberDiff line change
@@ -198,17 +198,6 @@ See the [tutorial](./plugin-tutorial.md) on writing a plugin in HLS.
198198

199199
## Measuring, benchmarking and tracing
200200

201-
### Metrics
202-
203-
When ghcide is built with the `ekg` flag, HLS opens a metrics server on port 8999 exposing GC and ghcide metrics. The ghcide metrics currently exposed are:
204-
205-
- `ghcide.values_count` - count of build results in the store
206-
- `ghcide.database_count` - count of build keys in the store (these two would be the same in the absence of GC)
207-
- `ghcide.build_count` - build count. A key is GC'ed if it is dirty and older than 100 builds
208-
- `ghcide.dirty_keys_count` - non transitive count of dirty build keys
209-
- `ghcide.indexing_pending_count` - count of items in the indexing queue
210-
- `ghcide.exports_map_count` - count of identifiers in the exports map.
211-
212201
### Benchmarks
213202

214203
If you are touching performance sensitive code, take the time to run a differential

ghcide/exe/Arguments.hs

-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ data Arguments = Arguments
2020
,argsVerbose :: Bool
2121
,argsCommand :: Command
2222
,argsConservativeChangeTracking :: Bool
23-
,argsMonitoringPort :: Int
2423
}
2524

2625
getArguments :: IdePlugins IdeState -> IO Arguments
@@ -43,7 +42,6 @@ arguments plugins = Arguments
4342
<*> switch (short 'd' <> long "verbose" <> help "Include internal events in logging output")
4443
<*> (commandP plugins <|> lspCommand <|> checkCommand)
4544
<*> switch (long "conservative-change-tracking" <> help "disable reactive change tracking (for testing/debugging)")
46-
<*> option auto (long "monitoring-port" <> metavar "PORT" <> value 8999 <> showDefault <> help "Port to use for EKG monitoring (if the binary is built with EKG)")
4745
where
4846
checkCommand = Check <$> many (argument str (metavar "FILES/DIRS..."))
4947
lspCommand = LSP <$ flag' True (long "lsp" <> help "Start talking to an LSP client")

ghcide/exe/Main.hs

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import Development.IDE.Core.Rules (mainRule)
1818
import qualified Development.IDE.Core.Rules as Rules
1919
import Development.IDE.Core.Tracing (withTelemetryLogger)
2020
import qualified Development.IDE.Main as IDEMain
21-
import qualified Development.IDE.Monitoring.EKG as EKG
2221
import qualified Development.IDE.Monitoring.OpenTelemetry as OpenTelemetry
2322
import qualified Development.IDE.Plugin.HLS.GhcIde as GhcIde
2423
import Development.IDE.Types.Options
@@ -148,5 +147,5 @@ main = withTelemetryLogger $ \telemetryLogger -> do
148147
, optRunSubset = not argsConservativeChangeTracking
149148
, optVerifyCoreFile = argsVerifyCoreFile
150149
}
151-
, IDEMain.argsMonitoring = OpenTelemetry.monitoring <> EKG.monitoring logger argsMonitoringPort
150+
, IDEMain.argsMonitoring = OpenTelemetry.monitoring
152151
}

ghcide/ghcide.cabal

-15
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@ source-repository head
2828
type: git
2929
location: https://github.com/haskell/haskell-language-server.git
3030

31-
flag ekg
32-
description:
33-
Enable EKG monitoring of the build graph and other metrics on port 8999
34-
35-
default: False
36-
manual: True
37-
3831
flag pedantic
3932
description: Enable -Werror
4033
default: False
@@ -178,7 +171,6 @@ library
178171
Development.IDE.LSP.Server
179172
Development.IDE.Main
180173
Development.IDE.Main.HeapStats
181-
Development.IDE.Monitoring.EKG
182174
Development.IDE.Monitoring.OpenTelemetry
183175
Development.IDE.Plugin
184176
Development.IDE.Plugin.Completions
@@ -218,13 +210,6 @@ library
218210
ghc-options:
219211
-Werror
220212

221-
if flag(ekg)
222-
build-depends:
223-
, ekg-core
224-
, ekg-wai
225-
226-
cpp-options: -DMONITORING_EKG
227-
228213
flag test-exe
229214
description: Build the ghcide-test-preprocessor executable
230215
default: True

ghcide/src/Development/IDE/Main.hs

+1-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ import Development.IDE.LSP.LanguageServer (runLanguageServer,
6565
import qualified Development.IDE.LSP.LanguageServer as LanguageServer
6666
import Development.IDE.Main.HeapStats (withHeapStats)
6767
import qualified Development.IDE.Main.HeapStats as HeapStats
68-
import qualified Development.IDE.Monitoring.EKG as EKG
6968
import qualified Development.IDE.Monitoring.OpenTelemetry as OpenTelemetry
7069
import Development.IDE.Plugin (Plugin (pluginHandlers, pluginModifyDynflags, pluginRules))
7170
import Development.IDE.Plugin.HLS (asGhcIdePlugin)
@@ -259,7 +258,7 @@ defaultArguments recorder logger plugins = Arguments
259258
-- the language server tests without the redirection.
260259
putStr " " >> hFlush stdout
261260
return newStdout
262-
, argsMonitoring = OpenTelemetry.monitoring <> EKG.monitoring logger 8999
261+
, argsMonitoring = OpenTelemetry.monitoring
263262
}
264263

265264

ghcide/src/Development/IDE/Monitoring/EKG.hs

-49
This file was deleted.

0 commit comments

Comments
 (0)