tkyprof 0.1.0.1 → 0.2.0
raw patch · 7 files changed
+24/−26 lines, 7 filesdep +resourcetdep +yesoddep −yesod-defaultdep −yesod-jsondep ~attoparsec-conduitdep ~conduitdep ~wai
Dependencies added: resourcet, yesod
Dependencies removed: yesod-default, yesod-json
Dependency ranges changed: attoparsec-conduit, conduit, wai, wai-extra, yesod-core, yesod-form, yesod-static
Files
- Controller.hs +0/−1
- Handler/Home.hs +1/−1
- Handler/Reports.hs +7/−6
- Handler/Reports/Helpers.hs +1/−1
- ProfilingReport.hs +1/−1
- TKYProf.hs +3/−5
- tkyprof.cabal +11/−11
Controller.hs view
@@ -7,7 +7,6 @@ import Data.ByteString (ByteString) import Data.Dynamic (Dynamic, toDyn)-import Network.Wai (Application) import Settings import TKYProf import Yesod.Static
Handler/Home.hs view
@@ -13,7 +13,7 @@ -- The majority of the code you will write in Yesod lives in these handler -- functions. You can spread them across multiple files if you are so -- inclined, or create a single monolithic file.-getHomeR :: Handler RepHtml+getHomeR :: Handler Html getHomeR = do reports <- getAllReports defaultLayout $ do
Handler/Reports.hs view
@@ -17,9 +17,10 @@ import qualified Data.Text.Lazy.Encoding as T (decodeUtf8) import Network.HTTP.Types.Status (seeOther303) import Data.Conduit (($$))+import Control.Monad.Trans.Resource (runResourceT) import Text.Julius -getReportsR :: Handler RepHtml+getReportsR :: Handler Html getReportsR = do reports <- getAllReports defaultLayout $ do@@ -35,13 +36,13 @@ _ -> do mapM_ postFileInfo files sendResponseCreated ReportsR -getReportsIdR :: ReportID -> Handler RepHtml+getReportsIdR :: ReportID -> Handler Html getReportsIdR reportId = redirectWith seeOther303 (ReportsIdTimeR reportId []) -getReportsIdTimeR :: ReportID -> [a] -> Handler RepHtml+getReportsIdTimeR :: ReportID -> [a] -> Handler Html getReportsIdTimeR reportId _ = getReportsIdCommon reportId "time" -getReportsIdAllocR :: ReportID -> [a] -> Handler RepHtml+getReportsIdAllocR :: ReportID -> [a] -> Handler Html getReportsIdAllocR reportId _ = getReportsIdCommon reportId "alloc" -- Helper functions@@ -54,10 +55,10 @@ postFileInfo :: FileInfo -> Handler ReportID postFileInfo info = do- prof <- lift $ fileSource info $$ profilingReportI+ prof <- runResourceT $ lift $ (fileSource info) $$ profilingReportI postProfilingReport prof -getReportsIdCommon :: ReportID -> Text -> Handler RepHtml+getReportsIdCommon :: ReportID -> Text -> Handler Html getReportsIdCommon reportId profilingType = do report@ProfilingReport {..} <- getProfilingReport reportId let json = rawJS $ T.decodeUtf8 $ A.encode reportCostCentres
Handler/Reports/Helpers.hs view
@@ -14,7 +14,7 @@ import ProfilingReport (ProfilingReport) import TKYProf (Handler, TKYProf(getReports)) import Yesod.Core (getYesod)-import Yesod.Handler (notFound)+import Yesod.Core.Handler (notFound) runReports :: STM a -> Handler a runReports = liftIO . atomically
ProfilingReport.hs view
@@ -84,7 +84,7 @@ , inheritedAlloc :: Double } deriving Show -profilingReportI :: MonadThrow m => GLSink ByteString m ProfilingReport+profilingReportI :: MonadThrow m => Sink ByteString m ProfilingReport profilingReportI = sinkParser profilingReport profilingReport :: Parser ProfilingReport
TKYProf.hs view
@@ -12,11 +12,9 @@ , module Control.Monad.STM , StaticRoute , lift- , liftIO ) where import Control.Monad (unless)-import Control.Monad.IO.Class (liftIO) import Control.Monad.STM (STM, atomically) import Control.Monad.Trans.Class (lift) import Model@@ -72,7 +70,7 @@ $(Settings.widgetFile "header") widget toWidget $(Settings.luciusFile "templates/default-layout.lucius")- hamletToRepHtml $(Settings.hamletFile "templates/default-layout.hamlet")+ giveUrlRenderer $(Settings.hamletFile "templates/default-layout.hamlet") -- This function creates static content files in the static folder -- and names them based on a hash of their content. This allows@@ -86,8 +84,8 @@ exists <- liftIO $ doesFileExist fn' unless exists $ liftIO $ L.writeFile fn' content return $ Just $ Right (StaticR $ StaticRoute ["tmp", T.pack fn] [], [])- - maximumContentLength _ _ = 20*1024*1024++ maximumContentLength _ _ = Just $ 20*1024*1024 instance YesodBreadcrumbs TKYProf where breadcrumb HomeR = return ("Home", Nothing)
tkyprof.cabal view
@@ -1,10 +1,10 @@ name: tkyprof-version: 0.1.0.1+version: 0.2.0 license: BSD3 license-file: LICENSE author: Mitsutoshi Aoe maintainer: Mitsutoshi Aoe <maoe@foldr.in>-copyright: Copyright (C) 2011 Mitsutoshi Aoe+copyright: Copyright (C) 2011-2013 Mitsutoshi Aoe synopsis: A web-based visualizer for GHC Profiling Reports description: A web-based visualizer for GHC Profiling Reports category: Development@@ -59,7 +59,7 @@ build-depends: base >= 4 && < 5 , aeson >= 0.3 && < 0.7 , attoparsec >= 0.9 && < 0.11- , attoparsec-conduit >= 0.5 && < 0.6+ , attoparsec-conduit >= 1.0 && < 1.1 , bytestring >= 0.9 && < 0.11 , cmdargs >= 0.7 && < 0.11 , containers < 0.6@@ -76,19 +76,19 @@ , time >= 1.2 && < 1.5 , transformers >= 0.2 && < 0.4 , vector >= 0.6 && < 1- , wai >= 0.4 && < 1.4- , wai-extra >= 0.4 && < 1.4+ , wai >= 0.4 && < 1.5+ , wai-extra >= 0.4 && < 1.5 , warp >= 0.4 && < 1.4 , web-routes >= 0.23 && < 0.28- , yesod-core >= 1.1 && < 1.7- , yesod-default >= 1.1 && < 1.2- , yesod-form >= 0.1 && < 1.3- , yesod-json >= 0.1 && < 1.2- , yesod-static >= 0.1 && < 1.2+ , yesod >= 1.2 && < 1.3+ , yesod-core >= 1.2 && < 1.3+ , yesod-form >= 1.3 && < 1.4+ , yesod-static >= 1.2 && < 1.3 , shakespeare-css >= 1.0 && < 1.1 , shakespeare-js >= 1.0 && < 1.2 , http-types >= 0.7 && < 1.0- , conduit >= 0.5 && < 0.6+ , conduit >= 1.0 && < 1.1+ , resourcet >= 0.4 && < 0.5 library if flag(devel)