Skip to content
Snippets Groups Projects
Commit da912c8f authored by Yorick Peterse's avatar Yorick Peterse
Browse files

Merge branch 'revert-influxdb-milliseconds' into 'master'

See merge request !2326
parents 0deeebc1 7ed3a5a2
No related branches found
No related tags found
No related merge requests found
Pipeline #
Loading
@@ -19,7 +19,7 @@ module Gitlab
Loading
@@ -19,7 +19,7 @@ module Gitlab
values = values_for(event) values = values_for(event)
tags = tags_for(event) tags = tags_for(event)
   
current_transaction.increment(:view_duration, duration(event)) current_transaction.increment(:view_duration, event.duration)
current_transaction.add_metric(SERIES, values, tags) current_transaction.add_metric(SERIES, values, tags)
end end
   
Loading
@@ -28,7 +28,7 @@ module Gitlab
Loading
@@ -28,7 +28,7 @@ module Gitlab
end end
   
def values_for(event) def values_for(event)
{ duration: duration(event) } { duration: event.duration }
end end
   
def tags_for(event) def tags_for(event)
Loading
@@ -48,10 +48,6 @@ module Gitlab
Loading
@@ -48,10 +48,6 @@ module Gitlab
def current_transaction def current_transaction
Transaction.current Transaction.current
end end
def duration(event)
event.duration * 1000.0
end
end end
end end
end end
Loading
Loading
Loading
@@ -8,7 +8,7 @@ module Gitlab
Loading
@@ -8,7 +8,7 @@ module Gitlab
def sql(event) def sql(event)
return unless current_transaction return unless current_transaction
   
current_transaction.increment(:sql_duration, duration(event)) current_transaction.increment(:sql_duration, event.duration)
end end
   
private private
Loading
@@ -16,10 +16,6 @@ module Gitlab
Loading
@@ -16,10 +16,6 @@ module Gitlab
def current_transaction def current_transaction
Transaction.current Transaction.current
end end
def duration(event)
event.duration * 1000.0
end
end end
end end
end end
Loading
Loading
Loading
@@ -21,7 +21,7 @@ describe Gitlab::Metrics::Subscribers::ActionView do
Loading
@@ -21,7 +21,7 @@ describe Gitlab::Metrics::Subscribers::ActionView do
   
describe '#render_template' do describe '#render_template' do
it 'tracks rendering of a template' do it 'tracks rendering of a template' do
values = { duration: 2100 } values = { duration: 2.1 }
tags = { tags = {
view: 'app/views/x.html.haml', view: 'app/views/x.html.haml',
file: 'app/views/x.html.haml', file: 'app/views/x.html.haml',
Loading
@@ -29,7 +29,7 @@ describe Gitlab::Metrics::Subscribers::ActionView do
Loading
@@ -29,7 +29,7 @@ describe Gitlab::Metrics::Subscribers::ActionView do
} }
   
expect(transaction).to receive(:increment). expect(transaction).to receive(:increment).
with(:view_duration, 2100) with(:view_duration, 2.1)
   
expect(transaction).to receive(:add_metric). expect(transaction).to receive(:add_metric).
with(described_class::SERIES, values, tags) with(described_class::SERIES, values, tags)
Loading
Loading
Loading
@@ -26,7 +26,7 @@ describe Gitlab::Metrics::Subscribers::ActiveRecord do
Loading
@@ -26,7 +26,7 @@ describe Gitlab::Metrics::Subscribers::ActiveRecord do
and_return(transaction) and_return(transaction)
   
expect(transaction).to receive(:increment). expect(transaction).to receive(:increment).
with(:sql_duration, 200) with(:sql_duration, 0.2)
   
subscriber.sql(event) subscriber.sql(event)
end end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment