omloga 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/omloga/request.rb +16 -1
- data/lib/omloga.rb +4 -2
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: e1a09f1d37411cdfb8dc303ab7c8350b18478ac6
         | 
| 4 | 
            +
              data.tar.gz: 64f016732252292f3accb2fa332a545047c24073
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 90acbdb13e3fdb2437d8833129706f299bf6ba05a4b518392a788df1da6df64cf7871a4a6ec3dde4ff39de6780aa00976a1f893a4f4034ad8613b71e39ac1e30
         | 
| 7 | 
            +
              data.tar.gz: ec3bc730f68597bc073f13ecf34cb5629b9c3ccb3a0a9a1a797cc5615581c5da3bbde6450ac1603462d4ed6d9f703c2f3afe5c40de4da51f87195e37e8845765
         | 
    
        data/lib/omloga/request.rb
    CHANGED
    
    | @@ -12,7 +12,20 @@ module Omloga | |
| 12 12 | 
             
                  @saved = false
         | 
| 13 13 | 
             
                  @count = 1
         | 
| 14 14 | 
             
                  @complete_count = 0
         | 
| 15 | 
            -
                  @ | 
| 15 | 
            +
                  @status = []
         | 
| 16 | 
            +
                  @path = []
         | 
| 17 | 
            +
                  @lines = []
         | 
| 18 | 
            +
                  add_start_line(start_line.to_s)
         | 
| 19 | 
            +
                end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                def add_start_line(line)
         | 
| 22 | 
            +
                  self.lines << line
         | 
| 23 | 
            +
                  self.path << line.match(/Started [A-Z]+ "(.+)"/)[1]
         | 
| 24 | 
            +
                end
         | 
| 25 | 
            +
             | 
| 26 | 
            +
                def add_end_line(line)
         | 
| 27 | 
            +
                  self.lines << line
         | 
| 28 | 
            +
                  self.status << line.match(/Completed ([2-5][0-9][0-9]) /)[1].to_i
         | 
| 16 29 | 
             
                end
         | 
| 17 30 |  | 
| 18 31 | 
             
                def mongo_doc
         | 
| @@ -20,6 +33,8 @@ module Omloga | |
| 20 33 | 
             
                    '_id' => id,
         | 
| 21 34 | 
             
                    'pid' => pid,
         | 
| 22 35 | 
             
                    'count' => count,
         | 
| 36 | 
            +
                    'path' => path,
         | 
| 37 | 
            +
                    'status' => status,
         | 
| 23 38 | 
             
                    'lines' => lines.join("")
         | 
| 24 39 | 
             
                  }
         | 
| 25 40 |  | 
    
        data/lib/omloga.rb
    CHANGED
    
    | @@ -104,7 +104,7 @@ def omloga(args) | |
| 104 104 |  | 
| 105 105 | 
             
                if is_start_line?(log_line)
         | 
| 106 106 | 
             
                  if req
         | 
| 107 | 
            -
                    req. | 
| 107 | 
            +
                    req.add_start_line(log_line)
         | 
| 108 108 | 
             
                    req.count+= 1
         | 
| 109 109 | 
             
                  else
         | 
| 110 110 | 
             
                    req = Omloga::Request.new(pid, log_line)
         | 
| @@ -117,9 +117,9 @@ def omloga(args) | |
| 117 117 | 
             
                    next 
         | 
| 118 118 | 
             
                  end
         | 
| 119 119 | 
             
                  is_complete = is_complete_line?(log_line)
         | 
| 120 | 
            -
                  req.lines << log_line
         | 
| 121 120 |  | 
| 122 121 | 
             
                  if is_complete
         | 
| 122 | 
            +
                    req.add_end_line(log_line)
         | 
| 123 123 | 
             
                    req.complete_count+= 1
         | 
| 124 124 |  | 
| 125 125 | 
             
                    if req.complete_count >= req.count
         | 
| @@ -127,6 +127,8 @@ def omloga(args) | |
| 127 127 | 
             
                      request_hash.delete(pid)
         | 
| 128 128 | 
             
                      request_count+= req.count
         | 
| 129 129 | 
             
                    end
         | 
| 130 | 
            +
                  else
         | 
| 131 | 
            +
                    req.lines << log_line
         | 
| 130 132 | 
             
                  end
         | 
| 131 133 | 
             
                end
         | 
| 132 134 | 
             
                line_count+= 1
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: omloga
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Srirang G Doddihal
         | 
| @@ -26,7 +26,7 @@ dependencies: | |
| 26 26 | 
             
                    version: 1.4.3
         | 
| 27 27 | 
             
            description: Stitches together log lines of every request and inserts them as one
         | 
| 28 28 | 
             
              record in MongoDB for easier analysis
         | 
| 29 | 
            -
            email:  | 
| 29 | 
            +
            email: saferanga-rubygems@yahoo.com
         | 
| 30 30 | 
             
            executables:
         | 
| 31 31 | 
             
            - omloga
         | 
| 32 32 | 
             
            extensions: []
         |