Class: CSGOLytics::FeedUpload
- Inherits:
-
Object
- Object
- CSGOLytics::FeedUpload
- Defined in:
- lib/csgolytics/feed_upload.rb
Constant Summary collapse
- PARTITION_SIZE =
3600 * 24
- EVENT_TABLE_MAP =
{ "frag" => "csgo_frags", "assist" => "csgo_assists" }
Instance Method Summary collapse
-
#initialize(db, server_id = nil) ⇒ FeedUpload
constructor
A new instance of FeedUpload.
- #insert_logline(logline, event_id = nil) ⇒ Object
Constructor Details
#initialize(db, server_id = nil) ⇒ FeedUpload
Returns a new instance of FeedUpload.
15 16 17 18 19 |
# File 'lib/csgolytics/feed_upload.rb', line 15 def initialize(db, server_id = nil) @db = db @server_id = server_id @log_parser = CSGOLytics::LogParser.new end |
Instance Method Details
#insert_logline(logline, event_id = nil) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/csgolytics/feed_upload.rb', line 21 def insert_logline(logline, event_id = nil) ev = @log_parser.parse(logline) unless ev return end if event_id ev[:event_id] = event_id else ev[:event_id] = Digest::SHA1.hexdigest logline end if @server_id ev[:server_id] = @server_id end upload_event(ev) end |