Class: Graphql::Dashboard::TracesController

Inherits:
ApplicationController show all
Defined in:
lib/graphql/dashboard.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#schema_class

Instance Method Details

#delete_allObject



103
104
105
106
# File 'lib/graphql/dashboard.rb', line 103

def delete_all
  schema_class.detailed_trace.delete_all_traces
  head :no_content
end

#destroyObject



98
99
100
101
# File 'lib/graphql/dashboard.rb', line 98

def destroy
  schema_class.detailed_trace.delete_trace(params[:id])
  head :no_content
end

#indexObject



84
85
86
87
88
89
90
91
# File 'lib/graphql/dashboard.rb', line 84

def index
  @detailed_trace_installed = !!schema_class.detailed_trace
  if @detailed_trace_installed
    @last = params[:last]&.to_i || 50
    @before = params[:before]&.to_i
    @traces = schema_class.detailed_trace.traces(last: @last, before: @before)
  end
end

#showObject



93
94
95
96
# File 'lib/graphql/dashboard.rb', line 93

def show
  trace = schema_class.detailed_trace.find_trace(params[:id].to_i)
  send_data(trace.trace_data)
end