Class: Tasker::AnalyticsService::BottleneckAnalytics

Inherits:
Object
  • Object
show all
Defined in:
app/services/tasker/analytics_service.rb

Overview

Bottleneck analytics data structure

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope_summary:, bottleneck_analysis:, performance_distribution:, recommendations:, scope:, analysis_period_hours:) ⇒ BottleneckAnalytics

Returns a new instance of BottleneckAnalytics.



37
38
39
40
41
42
43
44
45
46
# File 'app/services/tasker/analytics_service.rb', line 37

def initialize(scope_summary:, bottleneck_analysis:, performance_distribution:,
               recommendations:, scope:, analysis_period_hours:)
  @scope_summary = scope_summary
  @bottleneck_analysis = bottleneck_analysis
  @performance_distribution = performance_distribution
  @recommendations = recommendations
  @scope = scope
  @analysis_period_hours = analysis_period_hours
  @generated_at = Time.current
end

Instance Attribute Details

#analysis_period_hoursObject (readonly)

Returns the value of attribute analysis_period_hours.



34
35
36
# File 'app/services/tasker/analytics_service.rb', line 34

def analysis_period_hours
  @analysis_period_hours
end

#bottleneck_analysisObject (readonly)

Returns the value of attribute bottleneck_analysis.



34
35
36
# File 'app/services/tasker/analytics_service.rb', line 34

def bottleneck_analysis
  @bottleneck_analysis
end

#generated_atObject (readonly)

Returns the value of attribute generated_at.



34
35
36
# File 'app/services/tasker/analytics_service.rb', line 34

def generated_at
  @generated_at
end

#performance_distributionObject (readonly)

Returns the value of attribute performance_distribution.



34
35
36
# File 'app/services/tasker/analytics_service.rb', line 34

def performance_distribution
  @performance_distribution
end

#recommendationsObject (readonly)

Returns the value of attribute recommendations.



34
35
36
# File 'app/services/tasker/analytics_service.rb', line 34

def recommendations
  @recommendations
end

#scopeObject (readonly)

Returns the value of attribute scope.



34
35
36
# File 'app/services/tasker/analytics_service.rb', line 34

def scope
  @scope
end

#scope_summaryObject (readonly)

Returns the value of attribute scope_summary.



34
35
36
# File 'app/services/tasker/analytics_service.rb', line 34

def scope_summary
  @scope_summary
end

Instance Method Details

#to_hObject



48
49
50
51
52
53
54
55
56
57
58
# File 'app/services/tasker/analytics_service.rb', line 48

def to_h
  {
    scope_summary: scope_summary,
    bottleneck_analysis: bottleneck_analysis,
    performance_distribution: performance_distribution,
    recommendations: recommendations,
    scope: scope,
    analysis_period_hours: analysis_period_hours,
    generated_at: generated_at
  }
end