Class: RailsPulse::Suggestions::CacheSuggestionsService

Inherits:
Base
  • Object
show all
Defined in:
app/services/rails_pulse/suggestions/cache_suggestions_service.rb

Instance Attribute Summary

Attributes inherited from Base

#operation, #parent

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from RailsPulse::Suggestions::Base

Instance Method Details

#generateObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/services/rails_pulse/suggestions/cache_suggestions_service.rb', line 4

def generate
  suggestions = []

  if operation.operation_type == "cache_read" && operation.duration > 10
    suggestions << build_suggestion(
      type: "performance",
      icon: "clock",
      title: "Slow Cache Read",
      description: "Cache read took #{operation.duration.round(2)}ms. Check cache backend performance.",
      priority: "medium"
    )
  end

  suggestions
end