Class: Flare::SpansController

Inherits:
ApplicationController show all
Defined in:
app/controllers/flare/spans_controller.rb

Constant Summary collapse

PER_PAGE =
50
CATEGORIES =
{
  "queries" => { title: "Queries", icon: "database", badge_class: "sql" },
  "cache" => { title: "Cache", icon: "archive", badge_class: "cache" },
  "views" => { title: "Views", icon: "layout", badge_class: "view" },
  "http" => { title: "HTTP", icon: "globe", badge_class: "http" },
  "mail" => { title: "Mail", icon: "mail", badge_class: "mail" },
  "redis" => { title: "Redis", icon: "database", badge_class: "other" },
  "exceptions" => { title: "Exceptions", icon: "alert-triangle", badge_class: "exception" }
}.freeze

Instance Method Summary collapse

Instance Method Details

#cacheObject



25
26
27
# File 'app/controllers/flare/spans_controller.rb', line 25

def cache
  list_spans("cache")
end

#exceptionsObject



45
46
47
# File 'app/controllers/flare/spans_controller.rb', line 45

def exceptions
  list_spans("exceptions")
end

#httpObject



33
34
35
# File 'app/controllers/flare/spans_controller.rb', line 33

def http
  list_spans("http")
end

#mailObject



37
38
39
# File 'app/controllers/flare/spans_controller.rb', line 37

def mail
  list_spans("mail")
end

#queriesObject



21
22
23
# File 'app/controllers/flare/spans_controller.rb', line 21

def queries
  list_spans("queries")
end

#redisObject



41
42
43
# File 'app/controllers/flare/spans_controller.rb', line 41

def redis
  list_spans("redis")
end

#showObject



49
50
51
52
53
54
55
56
57
58
# File 'app/controllers/flare/spans_controller.rb', line 49

def show
  @span = Flare.storage.find_span(params[:id])

  if @span.blank?
    redirect_to requests_path, alert: "Span not found"
    return
  end

  @category = params[:category]
end

#viewsObject



29
30
31
# File 'app/controllers/flare/spans_controller.rb', line 29

def views
  list_spans("views")
end