Class: ClickHouse::Models::Ci::FinishedPipelinesDaily
- Inherits:
-
FinishedPipelinesBase
- Object
- Client::QueryLike
- BaseModel
- FinishedPipelinesBase
- ClickHouse::Models::Ci::FinishedPipelinesDaily
- Defined in:
- lib/click_house/models/ci/finished_pipelines_daily.rb
Constant Summary collapse
- TIME_BUCKETS_LIMIT =
366
Instance Attribute Summary
Attributes inherited from BaseModel
Class Method Summary collapse
- .table_name ⇒ Object
- .time_window_valid?(from_time, to_time) ⇒ Boolean
- .validate_time_window(from_time, to_time) ⇒ Object
Methods inherited from FinishedPipelinesBase
by_status, #by_status, #count_pipelines_function, #duration_quantile_function, for_container, #for_group, #for_project, #for_ref, #for_source, group_by_status, #group_by_status, #group_by_timestamp_bin, #timestamp_bin_function, #within_dates
Methods inherited from BaseModel
#group, #initialize, #limit, #offset, #order, #select, #where
Constructor Details
This class inherits a constructor from ClickHouse::Models::BaseModel
Class Method Details
.table_name ⇒ Object
9 10 11 |
# File 'lib/click_house/models/ci/finished_pipelines_daily.rb', line 9 def self.table_name 'ci_finished_pipelines_daily' end |
.time_window_valid?(from_time, to_time) ⇒ Boolean
13 14 15 |
# File 'lib/click_house/models/ci/finished_pipelines_daily.rb', line 13 def self.time_window_valid?(from_time, to_time) (to_time - from_time) / 1.day <= TIME_BUCKETS_LIMIT end |
.validate_time_window(from_time, to_time) ⇒ Object
17 18 19 20 21 |
# File 'lib/click_house/models/ci/finished_pipelines_daily.rb', line 17 def self.validate_time_window(from_time, to_time) return if time_window_valid?(from_time, to_time) "Maximum of #{TIME_BUCKETS_LIMIT} days can be requested" end |