Handler API¶
Abstract Class¶
Class¶
- class pyJoules.handler.print_handler.PrintHandler¶
- process(trace)¶
Print the given sample on the standard output
- class pyJoules.handler.csv_handler.CSVHandler(filename)¶
- __init__(filename)¶
- Parameters
filename (
str
) – file name to store processed trace
- save_data()¶
append processed trace to the file
- class pyJoules.handler.mongo_handler.MongoHandler(uri, database_name, collection_name, connected_timeout=30000, trace_name_prefix='trace_')¶
- __init__(uri, database_name, collection_name, connected_timeout=30000, trace_name_prefix='trace_')¶
Create a handler that will store data on mongo database
- Parameters
uri (
str
) – database uri using mongoDB uri formatconnection_timeout – Controls how long (in milliseconds) the driver will wait to find an available, appropriate server to carry out a database operation; while it is waiting, multiple server monitoring operations may be carried out, each controlled by connectTimeoutMS. Defaults to 30000 (30 seconds).
trace_name_prefix (
str
) – prefix of the trace name used to identify a trace in mongo database. The trace name is computed as follow : trace_name_prefix + trace_position (trace position is the position of the current trace in the trace list processed by the handler)
- save_data()¶
Save processed trace on the database