module SnsUtils

Constants

VERSION

Public Class Methods

create_test_log(line, rep=1_000) click to toggle source
# File lib/sns_utils.rb, line 27
def self.create_test_log(line, rep=1_000)
  File.open("#{::SnsUtils.root}/spec/fixtures/xlarge.log", "w+") do |f|
    rep.times do
      f.puts("2013-08-20 16:05:06,975 [http-8082-3] INFO  -   Rendered text template (0.0ms)")
      f.puts("2013-08-20 16:05:06,975 [http-8082-3] INFO  - Completed 200 OK in 5295ms (Views: 1.0ms | ActiveRecord: 0.0ms)")
      f.puts(line)
      f.puts("2013-08-20 16:08:39,281 [http-8082-3] INFO  - Redirected to https://apsearch-qa.berkeley.edu/login")
      f.puts("169.229.216.83 - - [25/Aug/2013:07:02:29 -0700] \"GET / HTTP/1.0\" 302 303 \"-\" \"check_http/v2053 (nagios-plugins 1.4.13)")
    end
  end
end
ip_out_file() click to toggle source
# File lib/sns_utils.rb, line 19
def self.ip_out_file
  "ip_addrs.txt"
end
mac_out_file() click to toggle source
# File lib/sns_utils.rb, line 23
def self.mac_out_file
  "mac_addrs.txt"
end
root() click to toggle source
# File lib/sns_utils.rb, line 15
def self.root
  @root ||= File.expand_path(File.join(File.dirname(__FILE__), ".."))
end