Thanks vm for this project which seems like it will really help me with log analysis. I'm trying to get to grips with what hit
and dam
do. I can see that they both create a Dam
object and add it into the list of defined dams. I am trying to work out, why there are 2 methods here, and when should I use 1, and when should I use the other?
I tried the following script, and it seems that hit is able to match each request for some given filter conditions.
Beaver.stream(Rails.configuration.paths['log']) do
hit :posts, :method => :post do |thing|
p thing
end
end
# calls back with a `Beaver::Parsers::Rails` for each post request which makes perfect sense
From the examples, it seems like dam is used to 'batch up' the previously matched requests, maybe at the end, once all the requests have been parsed? Is this right? Would another name for this method be all_hits(:posts)
returning an array (with additional methods) of matched hits?
Any guidance would be appreciated.