Class: LogAnalysis
- Inherits:
-
Object
- Object
- LogAnalysis
- Defined in:
- lib/log_analysis.rb,
lib/log_analysis/version.rb
Defined Under Namespace
Classes: Error
Constant Summary collapse
- VERSION =
'0.1.3'
Instance Attribute Summary collapse
-
#cleaned_data ⇒ Object
readonly
Your code goes here…
-
#path ⇒ Object
readonly
Your code goes here…
-
#type ⇒ Object
readonly
Your code goes here…
Instance Method Summary collapse
- #identified_session ⇒ Object
- #identified_user ⇒ Object
-
#initialize(path, type = nil) ⇒ LogAnalysis
constructor
A new instance of LogAnalysis.
- #move_data ⇒ Object
- #rule_generation(conf = 0.5, sup = 60) ⇒ Object
- #transformation ⇒ Object
Constructor Details
#initialize(path, type = nil) ⇒ LogAnalysis
Returns a new instance of LogAnalysis.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/log_analysis.rb', line 15 def initialize(path, type = nil) @path = path @type = type @cleaned_data = PreProcess.input(path, type) do |record| if block_given? yield(record) ? record : nil else record end end end |
Instance Attribute Details
#cleaned_data ⇒ Object (readonly)
Your code goes here…
13 14 15 |
# File 'lib/log_analysis.rb', line 13 def cleaned_data @cleaned_data end |
#path ⇒ Object (readonly)
Your code goes here…
13 14 15 |
# File 'lib/log_analysis.rb', line 13 def path @path end |
#type ⇒ Object (readonly)
Your code goes here…
13 14 15 |
# File 'lib/log_analysis.rb', line 13 def type @type end |
Instance Method Details
#identified_session ⇒ Object
31 32 33 |
# File 'lib/log_analysis.rb', line 31 def identified_session SessionIdentification.execute(@cleaned_data) end |
#identified_user ⇒ Object
27 28 29 |
# File 'lib/log_analysis.rb', line 27 def identified_user UserIdentification.execute(@cleaned_data) end |
#move_data ⇒ Object
45 46 47 48 49 |
# File 'lib/log_analysis.rb', line 45 def move_data system('mv', "transform_data_#{Time.now.strftime('%Y%m%d')}.txt", '/home/app/data/waazabag/') system('mv', "output_#{Time.now.strftime('%Y%m%d')}.txt", '/home/app/data/waazabag/') system('mv', "map_uri_#{Time.now.strftime('%Y%m%d')}.txt", '/home/app/data/waazabag/') end |
#rule_generation(conf = 0.5, sup = 60) ⇒ Object
39 40 41 42 43 |
# File 'lib/log_analysis.rb', line 39 def rule_generation(conf = 0.5, sup = 60) result = RuleGeneration.execute(transformation, conf, sup) move_data result end |
#transformation ⇒ Object
35 36 37 |
# File 'lib/log_analysis.rb', line 35 def transformation Transformation.execute(identified_session) end |