Skip to content

Remove EKG #4163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions bench/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,6 @@ buildHls Cabal root out = actionBracket
liftIO $ writeFile projectLocal $ unlines
["package haskell-language-server"
," ghc-options: -eventlog -rtsopts"
,"package ghcide"
," flags: +ekg"
]
return projectLocalExists)
(\projectLocalExists -> do
Expand Down
29 changes: 0 additions & 29 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,3 @@ constraints:
-- We want to be able to benefit from the performance optimisations
-- in the future, thus: TODO: remove this flag.
bitvec -simd

-- This is benign and won't affect our ability to release to Hackage,
-- because we only depend on `ekg-json` when a non-default flag
-- is turned on.
-- DELETE MARKER FOR CI
-- centos7 has an old version of git which cabal doesn't
-- support. We delete these lines in gitlab ci to workaround
-- this issue, as this is not necessary to build our binaries.
source-repository-package
type:git
location: https://github.com/pepeiborra/ekg-json
tag: 7a0af7a8fd38045fd15fb13445bdcc7085325460
-- END DELETE

if impl(ghc >= 9.1)
-- ekg packagess are old and unmaintained, but we
-- don't rely on them for the mainline build, so
-- this is okay
allow-newer:
ekg-json:base,
ekg-wai:time,
ekg-core:ghc-prim

if impl(ghc >= 9.7)
-- ekg packagess are old and unmaintained, but we
-- don't rely on them for the mainline build, so
-- this is okay
allow-newer:
ekg-core:text,
11 changes: 0 additions & 11 deletions docs/contributing/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,17 +198,6 @@ See the [tutorial](./plugin-tutorial.md) on writing a plugin in HLS.

## Measuring, benchmarking and tracing

### Metrics

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:

- `ghcide.values_count` - count of build results in the store
- `ghcide.database_count` - count of build keys in the store (these two would be the same in the absence of GC)
- `ghcide.build_count` - build count. A key is GC'ed if it is dirty and older than 100 builds
- `ghcide.dirty_keys_count` - non transitive count of dirty build keys
- `ghcide.indexing_pending_count` - count of items in the indexing queue
- `ghcide.exports_map_count` - count of identifiers in the exports map.

### Benchmarks

If you are touching performance sensitive code, take the time to run a differential
Expand Down
2 changes: 0 additions & 2 deletions ghcide/exe/Arguments.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ data Arguments = Arguments
,argsVerbose :: Bool
,argsCommand :: Command
,argsConservativeChangeTracking :: Bool
,argsMonitoringPort :: Int
}

getArguments :: IdePlugins IdeState -> IO Arguments
Expand All @@ -43,7 +42,6 @@ arguments plugins = Arguments
<*> switch (short 'd' <> long "verbose" <> help "Include internal events in logging output")
<*> (commandP plugins <|> lspCommand <|> checkCommand)
<*> switch (long "conservative-change-tracking" <> help "disable reactive change tracking (for testing/debugging)")
<*> option auto (long "monitoring-port" <> metavar "PORT" <> value 8999 <> showDefault <> help "Port to use for EKG monitoring (if the binary is built with EKG)")
where
checkCommand = Check <$> many (argument str (metavar "FILES/DIRS..."))
lspCommand = LSP <$ flag' True (long "lsp" <> help "Start talking to an LSP client")
3 changes: 1 addition & 2 deletions ghcide/exe/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import Development.IDE.Core.Rules (mainRule)
import qualified Development.IDE.Core.Rules as Rules
import Development.IDE.Core.Tracing (withTelemetryLogger)
import qualified Development.IDE.Main as IDEMain
import qualified Development.IDE.Monitoring.EKG as EKG
import qualified Development.IDE.Monitoring.OpenTelemetry as OpenTelemetry
import qualified Development.IDE.Plugin.HLS.GhcIde as GhcIde
import Development.IDE.Types.Options
Expand Down Expand Up @@ -148,5 +147,5 @@ main = withTelemetryLogger $ \telemetryLogger -> do
, optRunSubset = not argsConservativeChangeTracking
, optVerifyCoreFile = argsVerifyCoreFile
}
, IDEMain.argsMonitoring = OpenTelemetry.monitoring <> EKG.monitoring logger argsMonitoringPort
, IDEMain.argsMonitoring = OpenTelemetry.monitoring
}
15 changes: 0 additions & 15 deletions ghcide/ghcide.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ source-repository head
type: git
location: https://github.com/haskell/haskell-language-server.git

flag ekg
description:
Enable EKG monitoring of the build graph and other metrics on port 8999

default: False
manual: True

flag pedantic
description: Enable -Werror
default: False
Expand Down Expand Up @@ -178,7 +171,6 @@ library
Development.IDE.LSP.Server
Development.IDE.Main
Development.IDE.Main.HeapStats
Development.IDE.Monitoring.EKG
Development.IDE.Monitoring.OpenTelemetry
Development.IDE.Plugin
Development.IDE.Plugin.Completions
Expand Down Expand Up @@ -218,13 +210,6 @@ library
ghc-options:
-Werror

if flag(ekg)
build-depends:
, ekg-core
, ekg-wai

cpp-options: -DMONITORING_EKG

flag test-exe
description: Build the ghcide-test-preprocessor executable
default: True
Expand Down
3 changes: 1 addition & 2 deletions ghcide/src/Development/IDE/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ import Development.IDE.LSP.LanguageServer (runLanguageServer,
import qualified Development.IDE.LSP.LanguageServer as LanguageServer
import Development.IDE.Main.HeapStats (withHeapStats)
import qualified Development.IDE.Main.HeapStats as HeapStats
import qualified Development.IDE.Monitoring.EKG as EKG
import qualified Development.IDE.Monitoring.OpenTelemetry as OpenTelemetry
import Development.IDE.Plugin (Plugin (pluginHandlers, pluginModifyDynflags, pluginRules))
import Development.IDE.Plugin.HLS (asGhcIdePlugin)
Expand Down Expand Up @@ -259,7 +258,7 @@ defaultArguments recorder logger plugins = Arguments
-- the language server tests without the redirection.
putStr " " >> hFlush stdout
return newStdout
, argsMonitoring = OpenTelemetry.monitoring <> EKG.monitoring logger 8999
, argsMonitoring = OpenTelemetry.monitoring
}


Expand Down
49 changes: 0 additions & 49 deletions ghcide/src/Development/IDE/Monitoring/EKG.hs

This file was deleted.

Loading