Module: OpticsAgent::Reporting
- Included in:
- Agent, Query, QueryTrace, Report, Schema
- Defined in:
- lib/optics-agent/reporting/query.rb,
lib/optics-agent/reporting/report.rb,
lib/optics-agent/reporting/schema.rb,
lib/optics-agent/reporting/helpers.rb,
lib/optics-agent/reporting/report_job.rb,
lib/optics-agent/reporting/schema_job.rb,
lib/optics-agent/reporting/query-trace.rb
Defined Under Namespace
Classes: Query, QueryTrace, Report, ReportJob, Schema, SchemaJob
Instance Method Summary
collapse
Instance Method Details
#add_latency(counts, start_time, end_time) ⇒ Object
32
33
34
35
36
|
# File 'lib/optics-agent/reporting/helpers.rb', line 32
def add_latency(counts, start_time, end_time)
micros = (end_time - start_time) * 1e6
bucket = latency_bucket(micros)
counts[bucket] += 1
end
|
#client_info(rack_env) ⇒ Object
24
25
26
27
28
29
30
|
# File 'lib/optics-agent/reporting/helpers.rb', line 24
def client_info(rack_env)
{
client_name: 'none',
client_version: 'none',
client_address: '::1'
}
end
|
#duration_nanos(start_time, end_time) ⇒ Object
18
19
20
21
|
# File 'lib/optics-agent/reporting/helpers.rb', line 18
def duration_nanos(start_time, end_time)
throw "start_time before end_time" if (start_time > end_time)
((end_time - start_time) * 1e9).to_i
end
|
4
5
6
7
8
9
|
# File 'lib/optics-agent/reporting/helpers.rb', line 4
def
Apollo::Optics::Proto::.new({
agent_version: '0'
})
end
|
#generate_timestamp(time) ⇒ Object
11
12
13
14
15
16
|
# File 'lib/optics-agent/reporting/helpers.rb', line 11
def generate_timestamp(time)
Apollo::Optics::Proto::Timestamp.new({
seconds: time.to_i,
nanos: time.to_i % 1 * 1e9
});
end
|