获取帮助

    输出帮助信息结果如下:

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