Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This is a great question! Here's a first cut.</p> <blockquote> <p>Be able to log at multiple levels (ex: debug, warning, etc.).</p> </blockquote> <p><a href="http://hackage.haskell.org/package/hslogger" rel="noreferrer">hslogger</a> is easily the most popular logging framework. </p> <blockquote> <p>Be able to collect and share metrics/statistics about the types of work the program is doing and how long that work is taking. Ideally, the collected metrics are available in a format that's compatible with commonly-used monitoring tools like Ganglia, or can be so munged.</p> </blockquote> <p>I'm not aware of any standardized reporting tools, however, extracting reports from <code>+RTS -s</code> streams (or via profiling output flags) has been something I've done in the past. </p> <pre><code>$ ./A +RTS -s 64,952 bytes allocated in the heap 1 MB total memory in use %GC time 0.0% (6.1% elapsed) Productivity 100.0% of total user, 0.0% of total elapsed </code></pre> <p>You can get this in machine-readable format too:</p> <pre><code>$ ./A +RTS -t --machine-readable [("bytes allocated", "64952") ,("num_GCs", "1") ,("average_bytes_used", "43784") ,("max_bytes_used", "43784") ,("num_byte_usage_samples", "1") ,("peak_megabytes_allocated", "1") ,("init_cpu_seconds", "0.00") ,("init_wall_seconds", "0.00") ,("mutator_cpu_seconds", "0.00") ,("mutator_wall_seconds", "0.00") ,("GC_cpu_seconds", "0.00") ,("GC_wall_seconds", "0.00") ] </code></pre> <p>Ideally you could attach to a running GHC runtime over a socket and look at these GC stats interactively, but currently that's not super easy (needs an FFI bindings to the "rts/Stats.h" interface). You can attach to a process using <a href="http://research.microsoft.com/en-us/projects/threadscope/" rel="noreferrer"><code>ThreadScope</code></a> and monitor GC and threading behavior.</p> <p>Similar flags are available for incremental, logged <a href="http://book.realworldhaskell.org/read/profiling-and-optimization.html#id677833" rel="noreferrer">time</a> and <a href="http://book.realworldhaskell.org/read/profiling-and-optimization.html#id678078" rel="noreferrer">space</a> profiling, which can be used for monitoring (e.g. these <a href="https://i.stack.imgur.com/Hryc5.png" rel="noreferrer">graphs</a> can be built incrementally).</p> <p><a href="http://hackage.haskell.org/package/hpc" rel="noreferrer"><code>hpc</code></a> collects a lot of statistics about program execution, via its <code>Tix</code> type, and people have <a href="http://hackage.haskell.org/package/hpc-strobe" rel="noreferrer">written tools</a> to log by time-slice what code is executing.</p> <blockquote> <p>Be configurable, ideally via a system that allows configured properties in running programs to be updated without restarting said programs.</p> </blockquote> <p>Several tools are available for this, you can do xmonad-style state reloading; or move up to code hotswapping via <a href="http://hackage.haskell.org/package/direct-plugins" rel="noreferrer"><code>plugins</code></a>* packages or <a href="http://hackage.haskell.org/package/hint" rel="noreferrer"><code>hint</code></a>. Some of these are more experimental than others.</p> <blockquote> <p>Reproducible deployments</p> </blockquote> <p>Galois recently released <a href="http://hackage.haskell.org/package/cabal-dev" rel="noreferrer"><code>cabal-dev</code></a>, which is a tool for doing reproducible builds (i.e. dependencies are scoped and controlled).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload