Loading...
Searching...
No Matches
tf::ChromeObserver Class Reference

class to create an observer based on Chrome tracing format More...

#include <taskflow/core/observer.hpp>

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

Public Member Functions

void dump (std::ostream &ostream) const
 dumps the timelines into a Chrome Tracing format through an output stream
 
std::string dump () const
 dumps the timelines into a Chrome Tracing format
 
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
 

Detailed Description

class to create an observer based on Chrome tracing format

A tf::ChromeObserver inherits tf::ObserverInterface and defines methods to dump the observed thread activities into a format that can be visualized through Chrome Tracing.

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

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