write lua script for redis
$10-30 USD
S-au achitat serviciile după ce au fost prestate
write small piece of code in lua to do the following in redis
the script will get the following parameters:
1) path
2) increment_impression
3) increment_click
4) increment_conversion
5) amount
6) profit
logic of function:
split the path by ":"
loop on length of splitted array and do the following:
build key
if key exists
update the data of the key
else
create the key
example of calls
1:2:3, true, false, false, 0.003, 0.0001
output:
key impressions clicks conversions amount profit
1:_:_ 1 0 0 0.003 0.0001
1:2:_ 1 0 0 0.003 0.0001
1:2:3 1 0 0 0.003 0.0001
1:2:4, true, false, false, 0.003, 0.0002
output:
key impressions clicks conversions amount profit
1:_:_ 1 0 0 0.006 0.0003
1:2:_ 1 0 0 0.006 0.0003
1:2:3 1 0 0 0.003 0.0001
1:2:4 1 0 0 0.003 0.0002
1:2:3, true, false, false, 0.004, 0.0004
output:
key impressions clicks conversions amount profit
1:_:_ 3 0 0 0.01 0.0007
1:2:_ 3 0 0 0.01 0.0007
1:2:3 2 0 0 0.007 0.0005
1:2:4 1 0 0 0.003 0.0002
1:1:3, true, false, false, 0.001, 0.0001
output:
key impressions clicks conversions amount profit
1:_:_ 4 0 0 0.011 0.0008
1:1:_ 1 0 0 0.001 0.0001
1:1:3 1 0 0 0.001 0.0001
1:2:_ 3 0 0 0.01 0.0007
1:2:3 2 0 0 0.007 0.0005
1:2:4 1 0 0 0.003 0.0002
lua script will be uploaded to redis
developer needs to develop the script and help me to set it up on the redis using remote control to my computer
ID Proiect: #14213972