ITPub博客

首页 > 数据库 > 数据库开发技术 > openGauss学习笔记-298 openGauss AI特性-AI4DB数据库自治运维AI子功能-Forecast:趋势预测

openGauss学习笔记-298 openGauss AI特性-AI4DB数据库自治运维AI子功能-Forecast:趋势预测

原创 数据库开发技术 作者:shuchaoyang 时间:2024-02-24 07:00:00 0 删除 编辑

openGauss学习笔记-298 openGauss AI特性-AI4DB数据库自治运维-DBMind的AI子功能-Forecast:趋势预测298.1 概述298.2 环境部署298.3 使用指导298.4 获取帮助298.5 命令参考298.6 常见问题处理

openGauss学习笔记-298 openGauss AI特性-AI4DB数据库自治运维-DBMind的AI子功能-Forecast:趋势预测

298.1 概述

趋势预测功能模块主要实现基于历史时序数据预测未来时序变化趋势。该模块框架解耦,可以实现不同预测算法的灵活替换,并且该模块功能可以实现不同特征时序的算法自动选择,支持线性特征时序预测LR回归算法和非线性特征预测ARIMA算法。目前该模块可以覆盖线性时序、非线性时序和周期时序的准确预测。

298.2 环境部署

指标采集系统运行正常。

298.3 使用指导

假设用户已经初始化配置文件目录confpath,则可以通过下述命令实现本特性的功能:

  • 仅启动趋势预测功能,启动命令如下(更多用法参考对service子命令的说明)::

    gs_dbmind service start -c confpath --only-run forecast
  • 用户交互式趋势预测,查看某一instance的指标metric从timestamps0到timestamps1时间段内的预测结果,命令如下:

    gs_dbmind component forecast show -c confpath --metric-name metric --host instance --start-time timestamps0 --end-time timestamps1
  • 用户手动清理历史预测结果,命令如下:

    gs_dbmind component forecast clean -c confpath --retention-days DAYS
  • 用户自定义阈值下限low和上限up同时进行趋势预测,查看某一instance的指标metric从timestamps0到timestamps1时间段内的预测结果并查看预测值是否超出阈值,命令如下:

    gs_dbmind component forecast early-warning -c confpath --metric-name metric --host instance --start-time timestamps0 --end-time timestamps1 --upper up --lower low
  • 停止已启动的服务,命令如下:

    gs_dbmind service stop -c confpath

298.4 获取帮助

模块命令行说明:

gs_dbmind component forecast --help
usage: forecast.py [-h] -c DIRECTORY [--metric-name METRIC_NAME] [--host HOST]
                  [--labels LABELS] [--start-time TIMESTAMP_IN_MICROSECONDS]
                  [--end-time TIMESTAMP_IN_MICROSECONDS]
                  [--retention-days DAYS] [--upper UPPER] [--lower LOWER]
                  [--warning-hours WARNING-HOURS]
                  [--csv-dump-path CSV_DUMP_PATH]
                  {show,clean,early-warning}

Workload Forecasting: Forecast monitoring metrics

positional arguments:
{show,clean,early-warning}
                      Choose a functionality to perform

optional arguments:
 -h, --help           show this help message and exit
 -c DIRECTORY, --conf DIRECTORY
                      Set the directory of configuration files
 --metric-name METRIC_NAME
                      Set a metric name you want to retrieve
 --host HOST           Set a host you want to retrieve. IP only or IP with
                      port.
 --labels LABELS       A list of label (format is label=name) separated by
                      comma(,). Using in warning.
 --start-time TIMESTAMP_IN_MICROSECONDS
                      Set a start time for retrieving, supporting UNIX-
                      timestamp with microsecond or datetime format
 --end-time TIMESTAMP_IN_MICROSECONDS
                      Set an end time for retrieving, supporting UNIX-
                      timestamp with microsecond or datetime format
 --retention-days DAYS
                      Clear historical diagnosis results and set the maximum
                      number of days to retain data
 --upper UPPER         The upper value of early-warning. Using in warning.
 --lower LOWER         The lower value of early-warning. Using in warning.
 --warning-hours WARNING-HOURS
                      warning length, unit is hour.
 --csv-dump-path CSV_DUMP_PATH
                      Dump the result CSV file to the path if it is
                      specified. Use in warning.

298.5 命令参考

表 1 gs_dbmind component forecast 命令行说明

298.6 常见问题处理

  • 综合实际业务与模型预测效果考虑,趋势预测时长建议不要太短,建议大于3600秒(如果指标采集周期为15秒,则数据量为240个),否则预测效果会变差,并且数据量极小时,服务会异常,因此默认配置为3600秒

  • 配置文件中的参数重新设置后,需要重新启动服务进程才能生效。


👍 点赞,你的认可是我创作的动力!

⭐️ 收藏,你的青睐是我努力的方向!

✏️ 评论,你的意见是我进步的财富!


PS:因为公众号平台更改了推送规则,如果不想错过内容,记得读完点一下“在看”,加个“星标”,这样每次新文章推送才会第一时间出现在你的订阅列表里。点“在看”支持我吧!


原文作者:超哥的IT私房菜;如有侵权,请联系管理员删除。

请登录后发表评论 登录
全部评论
专注于IT系统集成、运维、架构二十年的IT职场老兵,拥有CCNA、OCA、OCP、PGCA、PGCE认证证书,公众号:超哥的IT私房菜,知识星球:超哥的IT私房菜,目前是多家IT厂商的咨询顾问。

注册时间:2021-08-27

  • 博文量
    552
  • 访问量
    303634