Taskflow  3.2.0-Master-Branch
Loading...
Searching...
No Matches
tf::TFProfObserver Class Reference

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

#include <observer.hpp>

Inheritance diagram for tf::TFProfObserver:
Collaboration diagram for tf::TFProfObserver:

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 clear ()
 clears the timeline data
 
size_t num_tasks () const
 queries the number of tasks observed
 
- 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
// run the taskflow
executor.run(taskflow).wait();
// dump the thread activities to Taskflow Profiler format.
observer->dump(std::cout);
class to create an executor for running a taskflow graph
Definition executor.hpp:50
tf::Future< void > run(Taskflow &taskflow)
runs a taskflow once
Definition executor.hpp:1573
std::shared_ptr< Observer > make_observer(ArgsT &&... args)
constructs an observer to inspect the activities of worker threads
Definition executor.hpp:1038
class to create an observer based on the built-in taskflow profiler format
Definition observer.hpp:447
class to create a taskflow object
Definition core/taskflow.hpp:73

We recommend using our Taskflow Profiler python script to observe thread activities instead of the raw function call. The script will turn on environment variables needed for observing all executors in a taskflow program and dump the result to a valid, clean JSON file compatible with the format of Taskflow Profiler.


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