Skip to content

Commit

Permalink
Update site with ticky example
Browse files Browse the repository at this point in the history
  • Loading branch information
mpickering committed Mar 31, 2023
1 parent 9be3187 commit 29028dd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
4 changes: 2 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ci ? false, haskellCompiler ? "ghc925" }:
{ci ? false, haskellCompiler ? "ghc927" }:
let
# Import the Haskell.nix library,
haskell-src = import ((import ./nix/sources.nix)."haskell.nix") {};
Expand All @@ -17,7 +17,7 @@ let
compiler-nix-name = haskellCompiler;
src = haskell.haskellLib.cleanGit { name = "eventlog2html"; src = ./.; };
modules = (if ci then ciOptions else []) ++ opts;
index-state = "2022-12-01T00:00:00Z";
index-state = "2023-03-25T00:00:00Z";
};


Expand Down
18 changes: 13 additions & 5 deletions hakyll-eventlog/site.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import Eventlog.Data
import Eventlog.Args
import Eventlog.VegaTemplate
import Eventlog.HtmlTemplate
import Eventlog.Ticky
import Text.Blaze.Html.Renderer.Text
import Options.Applicative
import Options.Applicative.Help.Types
Expand Down Expand Up @@ -114,9 +115,12 @@ drawEventlog :: [T.Text] -> Int -> ChartConfig -> IO T.Text
drawEventlog args vid conf = do
let final_args = ["--no-include-js"] ++ args
Run as <- handleParseResult (execParserPure defaultPrefs argsInfo (map T.unpack final_args))
(_, dat, _, _) <- generateJson (head $ files as) as
let itd = if traces conf then TraceData else NoTraceData
return $ TL.toStrict $ renderHtml $ renderChartWithJson itd (chartType conf) vid dat (vegaJsonText conf)
ty <- generateJson (head $ files as) as
return $ case ty of
HeapProfile (_, dat, _, _) ->
let itd = if traces conf then TraceData else NoTraceData
in TL.toStrict $ renderHtml $ renderChartWithJson itd (chartType conf) vid dat (vegaJsonText conf)
TickyProfile {} -> mempty

def :: ChartConfig
def = ChartConfig 600 500 True "category20" "set1" (AreaChart Stacked) Nothing
Expand Down Expand Up @@ -162,6 +166,10 @@ fullEventLogPage file = do
-- convenient.
Run as <- handleParseResult (execParserPure defaultPrefs argsInfo
[file, "--no-include-js", "--include-trace-events", "--limit-detailed=100"])
(header, data_json, descs, closure_descs) <- generateJson file as
return $ templateString header data_json descs closure_descs as
ty <- generateJson file as
case ty of
HeapProfile (header, data_json, descs, closure_descs) ->
return $ templateString header data_json descs closure_descs as
TickyProfile (header, tallocs, ticked_per, dat) ->
return $ tickyTemplateString header tallocs ticked_per dat as

6 changes: 3 additions & 3 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"homepage": "https://input-output-hk.github.io/haskell.nix",
"owner": "input-output-hk",
"repo": "haskell.nix",
"rev": "1a2bea5d67a211620da2460f1e19e3f6e9018935",
"sha256": "1l34bq8v5lp5ji7cx06l3rw03zlis151g5apqyyfm5xanc0q160z",
"rev": "af82dc3e464f58f5cc90400200f703e197d52e84",
"sha256": "0cdbxwqd8d22dxnqx6d1060hpjk5awwp4z5v5lvavp3p8fngg9cv",
"type": "tarball",
"url": "https://github.com/input-output-hk/haskell.nix/archive/1a2bea5d67a211620da2460f1e19e3f6e9018935.tar.gz",
"url": "https://github.com/input-output-hk/haskell.nix/archive/af82dc3e464f58f5cc90400200f703e197d52e84.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"niv": {
Expand Down

0 comments on commit 29028dd

Please sign in to comment.