获取帮助

启动调优程序之前,可以通过如下命令获取帮助信息:

  1. 源码方式:python main.py --help

输出帮助信息结果如下:

  1. usage:
  2. python main.py start [--role {{agent,collector,monitor}}] # start local service.
  3. python main.py stop [--role {{agent,collector,monitor}}] # stop local service.
  4. python main.py start [--user USER] [--host HOST] [--project-path PROJECT_PATH] [--role {{agent,collector,monitor}}]
  5. # start the remote service.
  6. python main.py stop [--user USER] [--host HOST] [--project-path PROJECT_PATH] [--role {{agent,collector,
  7. monitor}}] # stop the remote service.
  8. python main.py deploy [--user USER] [--host HOST] [--project-path PROJECT_PATH] # deploy project in remote host.
  9. python main.py diagnosis [--query] [--start_time] [--finish_time] # rca for slow SQL.
  10. python main.py show_metrics # display all monitored metrics(can only be executed on 'detector' machine).
  11. python main.py forecast [--metric-name METRIC_NAME] [--period] [--freq]
  12. [--forecast-method {{auto_arima, fbprophet}}] [--save-path SAVE_PATH] # forecast future trend of
  13. metric(can only be executed on 'detector' machine).
  14. Anomaly-detection: a time series forecast and anomaly detection tool.
  15. positional arguments:
  16. {start,stop,deploy,show_metrics,forecast,diagnosis}
  17. optional arguments:
  18. -h, --help show this help message and exit
  19. --user USER User of remote server.
  20. --host HOST IP of remote server.
  21. --project-path PROJECT_PATH
  22. Project location in remote server.
  23. --role {agent,collector,monitor}
  24. Run as 'agent', 'collector', 'monitor'. Notes: ensure
  25. the normal operation of the openGauss in agent.
  26. --metric-name METRIC_NAME
  27. Metric name to be predicted, you must provide an specified metric name.
  28. .
  29. --query QUERY target sql for RCA.
  30. Currently, the join operator is not supported, and the accuracy of the result
  31. is not guaranteed for SQL syntax containing "not null and".
  32. --start_time START_TIME
  33. start time of query
  34. --finish_time FINISH_TIME
  35. finish time of query
  36. --period PERIOD Forecast periods of metric, it should be integernotes:
  37. the specific value should be determined to the
  38. trainnig data.if this parameter is not provided, the
  39. default value '100S' will be used.
  40. --freq FREQ forecast gap, time unit: S: Second, M: Minute, H:
  41. Hour, D: Day, W: Week.
  42. --forecast-method FORECAST_METHOD
  43. Forecast method, default method is 'auto_arima',if
  44. want to use 'fbprophet', you should install fbprophet
  45. first.
  46. --save-path SAVE_PATH
  47. Save the results to this path using csv format, if
  48. this parameter is not provided,, the result wil not be
  49. saved.
  50. -v, --version show program's version number and exit
  51. epilog:
  52. the 'a-detection.conf' and 'metric_task.conf' will be read when the program is running,
  53. the location of them is:
  54. a-detection.conf: /openGauss-server/src/gausskernel/dbmind/tools/anomaly_detection/a-detection.conf.
  55. metric_config: /openGauss-server/src/gausskernel/dbmind/tools/anomaly_detection/task/metric_task.conf.