Commit 994c72a7 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[metrics] better logging of what's going on

parent 87c88da5
...@@ -93,6 +93,10 @@ updateScatter :: FlowCmdM env err m => ...@@ -93,6 +93,10 @@ updateScatter :: FlowCmdM env err m =>
-> Maybe Limit -> Maybe Limit
-> m () -> m ()
updateScatter cId maybeListId tabType maybeLimit = do updateScatter cId maybeListId tabType maybeLimit = do
printDebug "[updateScatter] cId" cId
printDebug "[updateScatter] maybeListId" maybeListId
printDebug "[updateScatter] tabType" tabType
printDebug "[updateScatter] maybeLimit" maybeLimit
_ <- updateScatter' cId maybeListId tabType maybeLimit _ <- updateScatter' cId maybeListId tabType maybeLimit
pure () pure ()
...@@ -181,6 +185,10 @@ updateChart :: HasNodeError err => ...@@ -181,6 +185,10 @@ updateChart :: HasNodeError err =>
-> Maybe Limit -> Maybe Limit
-> Cmd err () -> Cmd err ()
updateChart cId maybeListId tabType maybeLimit = do updateChart cId maybeListId tabType maybeLimit = do
printDebug "[updateChart] cId" cId
printDebug "[updateChart] maybeListId" maybeListId
printDebug "[updateChart] tabType" tabType
printDebug "[updateChart] maybeLimit" maybeLimit
_ <- updateChart' cId maybeListId tabType maybeLimit _ <- updateChart' cId maybeListId tabType maybeLimit
pure () pure ()
...@@ -261,6 +269,10 @@ updatePie :: FlowCmdM env err m => ...@@ -261,6 +269,10 @@ updatePie :: FlowCmdM env err m =>
-> Maybe Limit -> Maybe Limit
-> m () -> m ()
updatePie cId maybeListId tabType maybeLimit = do updatePie cId maybeListId tabType maybeLimit = do
printDebug "[updatePie] cId" cId
printDebug "[updatePie] maybeListId" maybeListId
printDebug "[updatePie] tabType" tabType
printDebug "[updatePie] maybeLimit" maybeLimit
_ <- updatePie' cId maybeListId tabType maybeLimit _ <- updatePie' cId maybeListId tabType maybeLimit
pure () pure ()
...@@ -352,6 +364,10 @@ updateTree :: FlowCmdM env err m => ...@@ -352,6 +364,10 @@ updateTree :: FlowCmdM env err m =>
-> ListType -> ListType
-> m () -> m ()
updateTree cId maybeListId tabType listType = do updateTree cId maybeListId tabType listType = do
printDebug "[updateTree] cId" cId
printDebug "[updateTree] maybeListId" maybeListId
printDebug "[updateTree] tabType" tabType
printDebug "[updateTree] listType" listType
_ <- updateTree' cId maybeListId tabType listType _ <- updateTree' cId maybeListId tabType listType
pure () pure ()
......
...@@ -120,8 +120,8 @@ import qualified Gargantext.API.Metrics as Metrics ...@@ -120,8 +120,8 @@ import qualified Gargantext.API.Metrics as Metrics
import Gargantext.API.Ngrams.Types import Gargantext.API.Ngrams.Types
import Gargantext.Core.Types (ListType(..), NodeId, ListId, DocId, Limit, Offset, HasInvalidError, TODO, assertValid) import Gargantext.Core.Types (ListType(..), NodeId, ListId, DocId, Limit, Offset, HasInvalidError, TODO, assertValid)
import Gargantext.Core.Utils (something) import Gargantext.Core.Utils (something)
import Gargantext.Core.Viz.Graph.API (recomputeGraph) -- import Gargantext.Core.Viz.Graph.API (recomputeGraph)
import Gargantext.Core.Viz.Graph.Distances (Distance(Conditional)) -- import Gargantext.Core.Viz.Graph.Distances (Distance(Conditional))
import Gargantext.Database.Action.Metrics.NgramsByNode (getOccByNgramsOnlyFast') import Gargantext.Database.Action.Metrics.NgramsByNode (getOccByNgramsOnlyFast')
import Gargantext.Database.Query.Table.Node.Select import Gargantext.Database.Query.Table.Node.Select
import Gargantext.Database.Query.Table.Ngrams hiding (NgramsType(..), ngrams, ngramsType, ngrams_terms) import Gargantext.Database.Query.Table.Ngrams hiding (NgramsType(..), ngrams, ngramsType, ngrams_terms)
...@@ -346,29 +346,50 @@ tableNgramsPut tabType listId (Versioned p_version p_table) ...@@ -346,29 +346,50 @@ tableNgramsPut tabType listId (Versioned p_version p_table)
node <- getNode listId node <- getNode listId
let nId = _node_id node let nId = _node_id node
uId = _node_userId node _uId = _node_userId node
mCId = _node_parentId node mCId = _node_parentId node
printDebug "[tableNgramsPut] updating graph with nId" nId -- printDebug "[tableNgramsPut] updating graph with nId" nId
printDebug "[tableNgramsPut] updating graph with uId" uId -- printDebug "[tableNgramsPut] updating graph with uId" uId
_ <- recomputeGraph uId nId Conditional -- _ <- recomputeGraph uId nId Conditional
printDebug "[tableNgramsPut] tabType" tabType
printDebug "[tableNgramsPut] listId" listId
_ <- case mCId of _ <- case mCId of
Nothing -> do Nothing -> do
printDebug "[tableNgramsPut] can't update charts, no parent, nId" nId printDebug "[tableNgramsPut] can't update charts, no parent, nId" nId
pure () pure ()
Just cId -> do Just cId -> do
printDebug "[tableNgramsPut] updating scatter cId" cId case tabType of
_ <- Metrics.updateScatter cId (Just listId) tabType Nothing Authors -> do
printDebug "[tableNgramsPut] updating chart cId" cId -- printDebug "[tableNgramsPut] Authors, updating Pie, cId" cId
_ <- Metrics.updateChart cId (Just listId) tabType Nothing _ <- Metrics.updatePie cId (Just listId) tabType Nothing
printDebug "[tableNgramsPut] updating pie cId" cId pure ()
_ <- Metrics.updatePie cId (Just listId) tabType Nothing Institutes -> do
printDebug "[tableNgramsPut] updating tree StopTerm, cId" cId -- printDebug "[tableNgramsPut] Institutes, updating Tree, cId" cId
_ <- Metrics.updateTree cId (Just listId) tabType StopTerm -- printDebug "[tableNgramsPut] updating tree StopTerm, cId" cId
printDebug "[tableNgramsPut] updating tree CandidateTerm, cId" cId _ <- Metrics.updateTree cId (Just listId) tabType StopTerm
_ <- Metrics.updateTree cId (Just listId) tabType CandidateTerm -- printDebug "[tableNgramsPut] updating tree CandidateTerm, cId" cId
printDebug "[tableNgramsPut] updating tree MapTerm, cId" cId _ <- Metrics.updateTree cId (Just listId) tabType CandidateTerm
_ <- Metrics.updateTree cId (Just listId) tabType MapTerm -- printDebug "[tableNgramsPut] updating tree MapTerm, cId" cId
_ <- Metrics.updateTree cId (Just listId) tabType MapTerm
pure ()
Sources -> do
-- printDebug "[tableNgramsPut] Sources, updating chart, cId" cId
_ <- Metrics.updateChart cId (Just listId) tabType Nothing
pure ()
Terms -> do
-- printDebug "[tableNgramsPut] Terms, updating Metrics (Histo), cId" cId
_ <- Metrics.updateChart cId (Just listId) tabType Nothing
_ <- Metrics.updatePie cId (Just listId) tabType Nothing
_ <- Metrics.updateScatter cId (Just listId) tabType Nothing
_ <- Metrics.updateTree cId (Just listId) tabType StopTerm
_ <- Metrics.updateTree cId (Just listId) tabType CandidateTerm
_ <- Metrics.updateTree cId (Just listId) tabType MapTerm
pure ()
_ -> do
printDebug "[tableNgramsPut] no update for tabType = " tabType
pure ()
pure () pure ()
pure ret pure ret
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment