forked from JosephPatrickCabanilla/support-engineer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
level3-static_pages_controller.rb
49 lines (43 loc) · 1.13 KB
/
level3-static_pages_controller.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
class StaticPagesController < ApplicationController
require 'statsd'
layout false
def common_tags
return ["support"]
end
def contact
start = Time.now
s = Statsd.new
tags = common_tags().push("page:contact")
s.increment('web.page_views', :tags => tags)
render 'contact'
lag = Time.now - start
s.histogram('latency', lag, :tags => tags)
end
def demoreel
start = Time.now
s = Statsd.new
tags = common_tags().push("page:demoreel")
s.increment('web.page_views', :tags => tags)
render 'demoreel'
lag = Time.now - start
s.histogram('latency', lag, :tags => tags)
end
def production
start = Time.now
s = Statsd.new
tags = common_tags().push("page:production")
s.increment('web.page_views', :tags => tags)
render 'production'
lag = Time.now - start
s.histogram('latency', lag, :tags => tags)
end
def resume
start = Time.now
s = Statsd.new
tags = common_tags().push("page:resume")
s.increment('web.page_views', :tags => tags)
render 'resume'
lag = Time.now - start
s.histogram('latency', lag, :tags => tags)
end
end