haxl-2.4.0.0: A Haskell library for efficient, concurrent, and concise data access.
Safe HaskellNone
LanguageHaskell2010

Haxl.Core.Stats

Description

Types and operations for statistics and profiling. Most users should import Haxl.Core instead of importing this module directly.

Synopsis

Data-source stats

newtype Stats Source #

Stats that we collect along the way.

Constructors

Stats [FetchStats] 

Instances

Instances details
Show Stats Source # 
Instance details

Defined in Haxl.Core.Stats

Methods

showsPrec :: Int -> Stats -> ShowS #

show :: Stats -> String #

showList :: [Stats] -> ShowS #

Semigroup Stats Source # 
Instance details

Defined in Haxl.Core.Stats

Methods

(<>) :: Stats -> Stats -> Stats #

sconcat :: NonEmpty Stats -> Stats #

stimes :: Integral b => b -> Stats -> Stats #

Monoid Stats Source # 
Instance details

Defined in Haxl.Core.Stats

Methods

mempty :: Stats #

mappend :: Stats -> Stats -> Stats #

mconcat :: [Stats] -> Stats #

ToJSON Stats Source # 
Instance details

Defined in Haxl.Core.Stats

data FetchStats Source #

Maps data source name to the number of requests made in that round. The map only contains entries for sources that made requests in that round.

Constructors

FetchStats

Timing stats for a (batched) data fetch

FetchCall

The stack trace of a call to dataFetch. These are collected only when profiling and reportLevel is 5 or greater.

MemoCall 

Fields

FetchWait 

Fields

FetchDataSourceStats 

Instances

Instances details
Eq FetchStats Source # 
Instance details

Defined in Haxl.Core.Stats

Show FetchStats Source # 
Instance details

Defined in Haxl.Core.Stats

ToJSON FetchStats Source # 
Instance details

Defined in Haxl.Core.Stats

data DataSourceStats Source #

Constructors

forall a.(Typeable a, Show a, Eq a, ToJSON a) => DataSourceStats a 

Instances

Instances details
Eq DataSourceStats Source # 
Instance details

Defined in Haxl.Core.Stats

Show DataSourceStats Source # 
Instance details

Defined in Haxl.Core.Stats

ppStats :: Stats -> String Source #

Pretty-print Stats.

ppFetchStats :: FetchStats -> String Source #

Pretty-print RoundStats.

aggregateFetchBatches :: ([FetchStats] -> a) -> Stats -> [a] Source #

Aggregate stats merging FetchStats from the same dispatched batch into one.

Profiling

data Profile Source #

Constructors

Profile 

Fields

data ProfileMemo Source #

Instances

Instances details
Eq ProfileMemo Source # 
Instance details

Defined in Haxl.Core.Stats

Show ProfileMemo Source # 
Instance details

Defined in Haxl.Core.Stats

data ProfileData Source #

Constructors

ProfileData 

Fields

Instances

Instances details
Show ProfileData Source # 
Instance details

Defined in Haxl.Core.Stats

Allocation

getAllocationCounter :: IO Int64 #

Return the current value of the allocation counter for the current thread.

Since: base-4.8.0.0

setAllocationCounter :: Int64 -> IO () #

Every thread has an allocation counter that tracks how much memory has been allocated by the thread. The counter is initialized to zero, and setAllocationCounter sets the current value. The allocation counter counts *down*, so in the absence of a call to setAllocationCounter its value is the negation of the number of bytes of memory allocated by the thread.

There are two things that you can do with this counter:

Allocation accounting is accurate only to about 4Kbytes.

Since: base-4.8.0.0