8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/statter/reporter_job.rb', line 8
def perform(config, type, name, data)
Statter::Agent.log("ReporterJob sending type: #{type}, name: #{name}, data: #{data}")
resp = HTTParty.post(
"#{config.url}/stats",
headers: {
"x-auth-header" => config.
},
body: {
type: type,
name: name,
data: data
}
)
Statter::Agent.log("sent type: #{type}, name: #{name}, data: #{data}, response: [#{resp.code}] #{resp..inspect}")
rescue => e
Statter::Agent.log("Exception sending type: #{type}, name: #{name}, data: #{data}: #{e.message}\n#{e.backtrace.join("\n")}")
end
|