haxl-2.0.1.0: A Haskell library for efficient, concurrent, and concise data access.

Safe HaskellNone
LanguageHaskell2010

Haxl.Core.Stats

Contents

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] 

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.

Fields

ppStats :: Stats -> String Source #

Pretty-print Stats.

ppFetchStats :: FetchStats -> String Source #

Pretty-print RoundStats.

Profiling

profile :: Profile -> HashMap ProfileLabel ProfileData Source #

Data on individual labels.

data ProfileData Source #

Constructors

ProfileData 

Fields

Allocation

getAllocationCounter :: IO Int64 #

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

Since: 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: 4.8.0.0