This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local ad = tonumber(ARGV[1]) | |
local BL = 1 | |
local weight = 0 | |
-- bid price constant will be 50p : 500000 /1000 = 500 | |
-- give up bid price constant will be 10p : 100000/1000 = 100 | |
local give_up_bid = 100 | |
-- Check if there is a weight | |
if tonumber(redis.call('zscore', 'ad:weights', ad)) == nil then | |
return nil | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'ipaddr' | |
parameter :today do | |
2.day.ago.to_date | |
end | |
helper :logs_union do | |
((today - 30.days)..today).map do |date| | |
""" | |
SELECT ip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'ipaddr' | |
parameter :today do | |
2.day.ago.to_date | |
end | |
helper :new_ips do | |
NOP(:RDW).from(:"logs__#{today.ymd}").select_map { distinct(:ip) } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load 30 days of ip files into RDW | |
parameter :today do | |
2.day.ago.to_date | |
end | |
execute do | |
files = NOP(:ARC).join("appnexus/**/ips_*.txt.gz") | |
sources = files.reject do |file| |
NewerOlder