Class: GraphQL::Tracing::PrometheusTrace::PrometheusMonitor::Event

Inherits:
MonitorTrace::Monitor::Event show all
Defined in:
lib/graphql/tracing/prometheus_trace.rb

Instance Attribute Summary

Attributes inherited from MonitorTrace::Monitor::Event

#keyword, #object

Instance Method Summary collapse

Methods inherited from MonitorTrace::Monitor::Event

#initialize

Constructor Details

This class inherits a constructor from GraphQL::Tracing::MonitorTrace::Monitor::Event

Instance Method Details

#finishObject



83
84
85
86
87
88
# File 'lib/graphql/tracing/prometheus_trace.rb', line 83

def finish
  if @monitor.active?(keyword)
    duration = @monitor.gettime - @start_time
    @monitor.send_json(duration, keyword, object)
  end
end

#startObject



79
80
81
# File 'lib/graphql/tracing/prometheus_trace.rb', line 79

def start
  @start_time = @monitor.gettime
end