Skip to content

Commit

Permalink
Output to framegraph stack format.
Browse files Browse the repository at this point in the history
  • Loading branch information
thealmarty committed Sep 24, 2021
1 parent 365f74e commit 7d8c903
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plutus-tx-plugin/executables/profile/Main.hs
Expand Up @@ -104,7 +104,7 @@ writeLogToFile fileName values = do
WriteMode
(\h -> hPutDoc h log)
processed <- processLog filePath
writeFile (filePath<>".stacks") $ show processed
writeFile (filePath<>".stacks") processed
pure ()

data Stacks
Expand Down Expand Up @@ -134,7 +134,11 @@ processLog file = do
lVar = map (!! 4) lEvents
lTripleTimeVar = zip3 (lUTC lTime) lEnterOrExit lVar
stacks = getStacks [] lTripleTimeVar
pure $ map (intercalate "; " . fst) stacks
fnsStacks = map (intercalate "; " . fst) stacks
stacksFgFormat (hdf:tlf) (hdt:tlt)=
hdf<>" "<>show hdt<>"\n":stacksFgFormat tlf tlt
stacksFgFormat _ _ = []
pure $ concat $ stacksFgFormat fnsStacks (map snd stacks)

lUTC :: [String] -> [UTCTime]
lUTC = map (read :: String -> UTCTime)
Expand Down

0 comments on commit 7d8c903

Please sign in to comment.