Reference documentation and code samples for the Cloud Monitoring V3 API class Google::Cloud::Monitoring::V3::AlertPolicy::Condition::MetricThreshold::ForecastOptions.
Options used when forecasting the time series and testing
the predicted value against the threshold.
(::Google::Protobuf::Duration) — Required. The length of time into the future to forecast whether a
time series will violate the threshold. If the predicted value is
found to violate the threshold, and the violation is observed in all
forecasts made for the configured duration, then the time series is
considered to be failing.
The forecast horizon can range from 1 hour to 60 hours.
value (::Google::Protobuf::Duration) — Required. The length of time into the future to forecast whether a
time series will violate the threshold. If the predicted value is
found to violate the threshold, and the violation is observed in all
forecasts made for the configured duration, then the time series is
considered to be failing.
The forecast horizon can range from 1 hour to 60 hours.
Returns
(::Google::Protobuf::Duration) — Required. The length of time into the future to forecast whether a
time series will violate the threshold. If the predicted value is
found to violate the threshold, and the violation is observed in all
forecasts made for the configured duration, then the time series is
considered to be failing.
The forecast horizon can range from 1 hour to 60 hours.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Cloud Monitoring V3 API - Class Google::Cloud::Monitoring::V3::AlertPolicy::Condition::MetricThreshold::ForecastOptions (v1.6.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.6.1 (latest)](/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-MetricThreshold-ForecastOptions)\n- [1.6.0](/ruby/docs/reference/google-cloud-monitoring-v3/1.6.0/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-MetricThreshold-ForecastOptions)\n- [1.5.1](/ruby/docs/reference/google-cloud-monitoring-v3/1.5.1/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-MetricThreshold-ForecastOptions)\n- [1.4.0](/ruby/docs/reference/google-cloud-monitoring-v3/1.4.0/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-MetricThreshold-ForecastOptions)\n- [1.3.0](/ruby/docs/reference/google-cloud-monitoring-v3/1.3.0/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-MetricThreshold-ForecastOptions)\n- [1.2.0](/ruby/docs/reference/google-cloud-monitoring-v3/1.2.0/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-MetricThreshold-ForecastOptions)\n- [1.1.0](/ruby/docs/reference/google-cloud-monitoring-v3/1.1.0/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-MetricThreshold-ForecastOptions)\n- [1.0.1](/ruby/docs/reference/google-cloud-monitoring-v3/1.0.1/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-MetricThreshold-ForecastOptions)\n- [0.18.0](/ruby/docs/reference/google-cloud-monitoring-v3/0.18.0/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-MetricThreshold-ForecastOptions)\n- [0.17.0](/ruby/docs/reference/google-cloud-monitoring-v3/0.17.0/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-MetricThreshold-ForecastOptions)\n- [0.16.0](/ruby/docs/reference/google-cloud-monitoring-v3/0.16.0/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-MetricThreshold-ForecastOptions)\n- [0.15.2](/ruby/docs/reference/google-cloud-monitoring-v3/0.15.2/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-MetricThreshold-ForecastOptions)\n- [0.14.0](/ruby/docs/reference/google-cloud-monitoring-v3/0.14.0/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-MetricThreshold-ForecastOptions)\n- [0.13.0](/ruby/docs/reference/google-cloud-monitoring-v3/0.13.0/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-MetricThreshold-ForecastOptions)\n- [0.12.1](/ruby/docs/reference/google-cloud-monitoring-v3/0.12.1/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-MetricThreshold-ForecastOptions)\n- [0.11.0](/ruby/docs/reference/google-cloud-monitoring-v3/0.11.0/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-MetricThreshold-ForecastOptions)\n- [0.10.0](/ruby/docs/reference/google-cloud-monitoring-v3/0.10.0/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-MetricThreshold-ForecastOptions)\n- [0.9.0](/ruby/docs/reference/google-cloud-monitoring-v3/0.9.0/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-MetricThreshold-ForecastOptions)\n- [0.8.0](/ruby/docs/reference/google-cloud-monitoring-v3/0.8.0/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-MetricThreshold-ForecastOptions)\n- [0.7.1](/ruby/docs/reference/google-cloud-monitoring-v3/0.7.1/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-MetricThreshold-ForecastOptions) \nReference documentation and code samples for the Cloud Monitoring V3 API class Google::Cloud::Monitoring::V3::AlertPolicy::Condition::MetricThreshold::ForecastOptions.\n\nOptions used when forecasting the time series and testing\nthe predicted value against the threshold. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #forecast_horizon\n\n def forecast_horizon() -\u003e ::Google::Protobuf::Duration\n\n**Returns**\n\n- ([::Google::Protobuf::Duration](./Google-Protobuf-Duration)) --- Required. The length of time into the future to forecast whether a time series will violate the threshold. If the predicted value is found to violate the threshold, and the violation is observed in all forecasts made for the configured `duration`, then the time series is considered to be failing. The forecast horizon can range from 1 hour to 60 hours.\n\n### #forecast_horizon=\n\n def forecast_horizon=(value) -\u003e ::Google::Protobuf::Duration\n\n**Parameter**\n\n- **value** ([::Google::Protobuf::Duration](./Google-Protobuf-Duration)) --- Required. The length of time into the future to forecast whether a time series will violate the threshold. If the predicted value is found to violate the threshold, and the violation is observed in all forecasts made for the configured `duration`, then the time series is considered to be failing. The forecast horizon can range from 1 hour to 60 hours. \n**Returns**\n\n- ([::Google::Protobuf::Duration](./Google-Protobuf-Duration)) --- Required. The length of time into the future to forecast whether a time series will violate the threshold. If the predicted value is found to violate the threshold, and the violation is observed in all forecasts made for the configured `duration`, then the time series is considered to be failing. The forecast horizon can range from 1 hour to 60 hours."]]