| Taskflow: A General-purpose Task-parallel Programming System

Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
tf::TFProfObserver Class Reference

class to create an observer based on the built-in taskflow profiler format More...

`#include <taskflow/core/observer.hpp>`

Inheritance diagram for tf::TFProfObserver:
[legend]
Collaboration diagram for tf::TFProfObserver:
[legend]

## Public Member Functions
void | dump (std::ostream &ostream) const
| dumps the timelines into a Taskflow Profiler format through an output stream
std::string | dump () const
| dumps the timelines into a JSON string
void | summary (std::ostream &ostream) const
| shows the summary report through an output stream
std::string | summary () const
| returns the summary report in a string
void | clear ()
| clears the timeline data
size_t | num_tasks () const
| queries the number of tasks observed
size_t | num_workers () const
| queries the number of observed workers
Public Member Functions inherited from tf::ObserverInterface
virtual | ~ObserverInterface ()=default
| virtual destructor

## Friends
class | Executor
class | TFProfManager

## Detailed Description

class to create an observer based on the built-in taskflow profiler format

A tf::TFProfObserver inherits tf::ObserverInterface and defines methods to dump the observed thread activities into a format that can be visualized through Taskflow Profiler.

tf::Taskflow taskflow;
tf::Executor executor;
// insert tasks into taskflow
// ...
// create a custom observer
std::shared_ptr<tf::TFProfObserver> observer = executor.make_observer<tf::TFProfObserver>();
// run the taskflow
executor.run(taskflow).wait();
// dump the thread activities to Taskflow Profiler format.
observer->dump(std::cout);
tf::Executor
class to create an executor
Definition executor.hpp:62
tf::Executor::run
tf::Future< void > run(Taskflow &taskflow)
runs a taskflow once
tf::Executor::make_observer
std::shared_ptr< Observer > make_observer(ArgsT &&... args)
constructs an observer to inspect the activities of worker threads
tf::TFProfObserver
class to create an observer based on the built-in taskflow profiler format
Definition observer.hpp:441
tf::Taskflow
class to create a taskflow object
Definition taskflow.hpp:64

The documentation for this class was generated from the following file:

- taskflow/core/observer.hpp