Files
WPIQ/wo/cli/plugins/import_slow_log.py

32 lines
960 B
Python
Raw Permalink Normal View History

2019-09-04 20:36:15 +02:00
from cement.core.controller import CementBaseController, expose
2018-11-13 21:55:59 +01:00
from wo.core.logging import Log
def wo_import_slow_log_hook(app):
pass
class WOImportslowlogController(CementBaseController):
class Meta:
label = 'import_slow_log'
stacked_on = 'base'
stacked_type = 'nested'
description = 'Import MySQL slow log to Anemometer database'
usage = "wo import-slow-log"
@expose(hide=True)
def default(self):
Log.info(self, "This command is deprecated."
" You can use this command instead, " +
Log.ENDC + Log.BOLD + "\n`wo debug --import-slow-log`" +
Log.ENDC)
def load(app):
# register the plugin class.. this only happens if the plugin is enabled
2019-09-24 00:01:20 +02:00
app.handler.register(WOImportslowlogController)
2018-11-13 21:55:59 +01:00
# register a hook (function) to run after arguments are parsed.
2019-09-24 00:04:32 +02:00
app.hook.register('post_argument_parsing', wo_import_slow_log_hook)