diff options
author | Joey Hess <joey@kitenet.net> | 2013-11-06 16:33:45 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-11-06 16:33:45 -0400 |
commit | c86c3dd1d1d18747d42dfafcbaa4d5e87f41892b (patch) | |
tree | fbd70ee78127b4291f391e91eb6050744a99f5f2 | |
parent | e040b23aa1754ca4e210a79969ca5b146c1120f0 (diff) |
Allow optionally configuring git-annex with -fEKG to enable awesome remote monitoring interfaceat http://localhost:4242/
-rw-r--r-- | BuildFlags.hs | 3 | ||||
-rw-r--r-- | GitAnnex.hs | 11 | ||||
-rw-r--r-- | debian/changelog | 7 | ||||
-rw-r--r-- | doc/ekg.mdwn | 14 | ||||
-rw-r--r-- | doc/ekg/ekg.png | bin | 0 -> 57392 bytes | |||
-rw-r--r-- | doc/install/cabal.mdwn | 6 | ||||
-rw-r--r-- | git-annex.cabal | 9 |
7 files changed, 48 insertions, 2 deletions
diff --git a/BuildFlags.hs b/BuildFlags.hs index 40d5bb29b..1dba47eaf 100644 --- a/BuildFlags.hs +++ b/BuildFlags.hs @@ -60,4 +60,7 @@ buildFlags = filter (not . null) #ifdef WITH_CRYPTOHASH , "CryptoHash" #endif +#ifdef WITH_EKG + , "EKG" +#endif ] diff --git a/GitAnnex.hs b/GitAnnex.hs index b73cd9416..d6de50d03 100644 --- a/GitAnnex.hs +++ b/GitAnnex.hs @@ -5,7 +5,7 @@ - Licensed under the GNU GPL version 3 or higher. -} -{-# LANGUAGE CPP #-} +{-# LANGUAGE CPP, OverloadedStrings #-} module GitAnnex where @@ -87,6 +87,9 @@ import qualified Command.XMPPGit import qualified Command.Test import qualified Command.FuzzTest #endif +#ifdef WITH_EKG +import System.Remote.Monitoring +#endif cmds :: [Command] cmds = concat @@ -169,4 +172,8 @@ header :: String header = "git-annex command [option ...]" run :: [String] -> IO () -run args = dispatch True args cmds options [] header Git.CurrentRepo.get +run args = do +#ifdef WITH_EKG + _ <- forkServer "localhost" 4242 +#endif + dispatch True args cmds options [] header Git.CurrentRepo.get diff --git a/debian/changelog b/debian/changelog index 17911cab5..b7a73d3a1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +git-annex (4.20131107) UNRELEASED; urgency=low + + * Allow optionally configuring git-annex with -fEKG to enable awesome + remote monitoring interfaceat http://localhost:4242/ + + -- Joey Hess <joeyh@debian.org> Wed, 06 Nov 2013 16:14:14 -0400 + git-annex (4.20131106) unstable; urgency=low * Improve local pairing behavior when two computers both try to start diff --git a/doc/ekg.mdwn b/doc/ekg.mdwn new file mode 100644 index 000000000..3bbea8614 --- /dev/null +++ b/doc/ekg.mdwn @@ -0,0 +1,14 @@ +You can `cabal configure -fEKG` to build a git-annex that includes +the EKG remote monitoring interface. + +To access the EKG control panel, go to +<http://localhost:4242/> while a git-annex command is running. + +This EKG build is mostly useful for debugging resource usage problems. + +[[!img ekg.png caption="git-annex webapp startup, and assistant startup scan"]] + +Note that since only one process can open port 4242 at a time, running +more than one git-annex process with EKG support at the same time can +result in some "resource busy (Address already in use)" messages -- but +git-annex will continue to work. diff --git a/doc/ekg/ekg.png b/doc/ekg/ekg.png Binary files differnew file mode 100644 index 000000000..a8d16a2d8 --- /dev/null +++ b/doc/ekg/ekg.png diff --git a/doc/install/cabal.mdwn b/doc/install/cabal.mdwn index 4eac597f1..3270dd0f9 100644 --- a/doc/install/cabal.mdwn +++ b/doc/install/cabal.mdwn @@ -50,3 +50,9 @@ you want, and use cabal as follows inside its source tree: cabal configure cabal build cabal install --bindir=$HOME/bin + +## EKG + +When building with cabal, you can optionally enable the +[[EKG monitoring interface|ekg]]. This is great for debugging resource +usage problems. diff --git a/git-annex.cabal b/git-annex.cabal index ef0259e7a..848477c18 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -74,6 +74,10 @@ Flag Quvi Flag CryptoHash Description: Enable use of cryptohash for checksumming +Flag EKG + Description: Enable use of EKG to monitor git-annex as it runs (at http://localhost:4242/) + Default: False + Executable git-annex Main-Is: git-annex.hs Build-Depends: MissingH, hslogger, directory, filepath, @@ -177,6 +181,11 @@ Executable git-annex Build-Depends: aeson CPP-Options: -DWITH_QUVI + if flag(EKG) + Build-Depends: ekg + GHC-Options: -with-rtsopts=-T + CPP-Options: -DWITH_EKG + source-repository head type: git location: git://git-annex.branchable.com/ |