A.48 library(statistics): Get information about resource usage
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • The SWI-Prolog library
        • library(statistics): Get information about resource usage
          • statistics/0
          • statistics/1
          • thread_statistics/2
          • time/1
          • call_time/2
          • call_time/3
          • profile/1
          • profile/2
          • show_profile/1
          • profile_data/1
          • profile_procedure_data/2
    • Packages
Availability::- use_module(library(statistics)).(can be autoloaded)
Source[det]profile_data(-Data)
Gather all relevant data from profiler. This predicate may be called while profiling is active in which case it is suspended while collecting the data. Data is a dict providing the following fields:
summary:Dict
Overall statistics providing

  • samples:Count: Times the statistical profiler was called
  • ticks:Count Virtual ticks during profiling
  • accounting:Count Tick spent on accounting
  • time:Seconds Total time sampled
  • nodes:Count Nodes in the call graph.
nodes
List of nodes. Each node provides:

  • predicate:PredicateIndicator
  • ticks_self:Count
  • ticks_siblings:Count
  • call:Count
  • redo:Count
  • exit:Count
  • callers:list_of(Relative)
  • callees:list_of(Relative)

Relative is a term of the shape below that represents a caller or callee. Future versions are likely to use a dict instead.

node(PredicateIndicator, CycleID, Ticks, TicksSiblings,
     Calls, Redos, Exits)