Exemple #1
0
 def create(cls, file, module, cls_name, func, elapsed):
     """Inserts a new time sample into the database with the given information.
     
     :param file: The file the sample is from
     :type file: str
     :param module: The module the sample is from
     :type module: str
     :param cls_name: The name of the class the sample is from
     :type cls_name: str
     :param func: The name of the function the sample is from
     :type func: str
     :param elapsed: The elapsed time in seconds
     :type elapsed: float
     
     """
     q = "INSERT INTO {} VALUES('{}', '{}', '{}', '{}', {})"
     SqliteConnection.get().execute(
         q.format(cls.meta['table'], file, module, cls_name, func, elapsed))
Exemple #2
0
 def configure(self, options, conf):
     """Configure this plugin using the given options"""
     super(PerfDumpPlugin, self).configure(options, conf)
     if not self.enabled:
         return
     try:
         self.html_output_file = options.perfdump_html_file
     except:
         pass
     self.db = SqliteConnection.get(self.database_name)
Exemple #3
0
 def configure(self, options, conf):
     """Configure this plugin using the given options"""
     super(PerfDumpPlugin, self).configure(options, conf)
     if not self.enabled:
         return
     try:
         self.html_output_file = options.perfdump_html_file
     except:
         pass
     self.db = SqliteConnection.get(self.database_name)
Exemple #4
0
 def create(cls, file, module, cls_name, func, elapsed):
     """Inserts a new time sample into the database with the given information.
     
     :param file: The file the sample is from
     :type file: str
     :param module: The module the sample is from
     :type module: str
     :param cls_name: The name of the class the sample is from
     :type cls_name: str
     :param func: The name of the function the sample is from
     :type func: str
     :param elapsed: The elapsed time in seconds
     :type elapsed: float
     
     """
     q = "INSERT INTO {} VALUES('{}', '{}', '{}', '{}', {})"
     SqliteConnection.get().execute(q.format(cls.meta['table'],
                                             file,
                                             module,
                                             cls_name,
                                             func,
                                             elapsed))
Exemple #5
0
 def preloop(self):
     self.db = SqliteConnection.get()
     self.db.row_factory = sqlite3.Row
Exemple #6
0
 def get_cursor(cls):
     """Return a message list cursor that returns sqlite3.Row objects"""
     db = SqliteConnection.get()
     db.row_factory = sqlite3.Row
     return db.cursor()
Exemple #7
0
 def get_cursor(cls):
     """Return a message list cursor that returns sqlite3.Row objects"""
     db = SqliteConnection.get()
     db.row_factory = sqlite3.Row
     return db.cursor()