Changeset 61903febed2d9becbc4659f7d3cde0e19ae87d14

Show
Ignore:
Timestamp:
10/31/11 19:08:24 (2 years ago)
Author:
Ryan Phillips <ryan.phillips@rackspace.com>
git-committer:
Ryan Phillips <ryan.phillips@rackspace.com> 1320088104 -0500
git-parent:

[23e807a144fa1f89d334518ea4a32eacfe154008]

git-author:
Ryan Phillips <ryan.phillips@rackspace.com> 1320088104 -0500
Message:

add truncated metric and fix a bug

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/modules-lua/noit/HttpClient.lua

    r23e807a r61903fe  
    4444    self.target = target 
    4545    self.port = port 
     46    self.truncated = nil 
    4647    local rv, err = self.e:connect(self.target, self.port) 
    4748    if rv ~= 0 then 
     
    134135    if read_limit and read_limit > 0 and len > read_limit then 
    135136      len = read_limit 
     137      self.truncated = true 
    136138    end 
    137139    repeat 
     
    166168        if read_limit and read_limit > 0 then 
    167169          if string.len(self.content_bytes) > read_limit then 
     170            self.truncated = true 
    168171            return 
    169172          end 
  • src/modules-lua/noit/module/http.lua

    r201e9d3 r61903fe  
    274274    local pcre_match_limit = check.config.pcre_match_limit or 10000 
    275275    local redirects = check.config.redirects or 0 
    276     local read_limit = check.config.read_limit or 102400 
     276    local read_limit = tonumber(check.config.read_limit) or 102400 
    277277 
    278278    -- expect the worst 
     
    452452    end 
    453453 
     454    -- truncated response 
     455    check.metric_uint32("truncated", client.truncated and 1 or 0) 
     456 
    454457    -- turnaround time 
    455458    local seconds = elapsed(check, "duration", starttime, endtime)