#-*-coding:utf-8-*-
from rediscluster import StrictRedisCluster
import pymysql
import time
import cProfile
import timeit

def get_redis_connection():
rc = StrictRedisCluster(startup_nodes=[{'host':'10.101.32.97', 'port':1633}, {'host': '10.101.32.95', 'port':1633}, {'host': '10.101.32.96', 'port': 1633}],decode_responses=True)
return rc

def get_redis_value(command):
rc = get_redis_connection()
# Sspent = showCnt = Cspent = clickCnt = 0
allAppStoreSpent = allCashSpent = 0
for key in rc.scan_iter(match = command):
print(key)
re = rc.hgetall(key)
if 'cashSpent' in re:
i = int(re['cashSpent'])
allCashSpent = i + allCashSpent
elif 'appStoreDiscountSpent' in re:
x = int(re['appStoreDiscountSpent'])
allAppStoreSpent = x + allAppStoreSpent
else:
return False
return "allCashSpent: " + str(allCashSpent), "allAppStoreSpent: " + str(allAppStoreSpent)

if __name__ == "__main__":
valueN = get_redis_value('billing:advertiser:spent:????????????????????')
print(valueN)

#-*-coding:utf-8-*-
from rediscluster import StrictRedisCluster
import pymysql
import time
import cProfile
import timeit

def get_redis_connection():
rc = StrictRedisCluster(startup_nodes=[{'host':'10.101.82.101', 'port':6379}, {'host': '10.101.81.25', 'port':6379}, {'host': '10.101.82.31', 'port': 6379}],decode_responses=True)
return rc

def get_redis_value():
rc1 = get_redis_connection()
count = 1
while (count < 2):
#key="DL:1:8765432100000" + str(count) +":com.athinkthings.note.android.phone"
key="DL:IMEI:87654321000000" + str(count) +":com.athinkthings.note.android.phone"
rc1.hset(key, "creativeId", "20004641")
rc1.hset(key, "serviceTime", "1571194801000")
print ('The count is:', count)
count = count + 1

if __name__ == "__main__":
valueN = get_redis_value()
print(valueN)

最新文章

  1. 页面滚动到底部自动 Ajax 获取文章
  2. Oracle OCP 1Z0-053 Exam Topics
  3. Xilinx DCM 使用---- 输出频率问题
  4. 20145235 《Java程序设计》实验二
  5. CCS float vs clear
  6. IE 不兼容的几个js问题及解决方法1
  7. POJ-3207 Ikki&#39;s Story IV - Panda&#39;s Trick 2sat
  8. iOS textfield实现一行的数字限制,超出进行弹框
  9. MongoDB性能优化指南
  10. 数据库框架 Litepal
  11. Java习惯用法总结
  12. 在VMware中为Linux系统安装VM-Tools的详解教程
  13. 《第一行代码》学习笔记28-内容提供器Content Provider(1)
  14. perl eval函数
  15. DeviceIoControl的使用说明
  16. SVN和Git的一些用法总结
  17. 读《Java并发编程的艺术》(二)
  18. Eclipse使用JDBC小案例
  19. supergridcontrol记录,分页
  20. 11.redis_python

热门文章

  1. CentOS7用rpmforge源!
  2. java中的javap命令(工作中补充的知识)
  3. Chrome调试小技巧
  4. testNG官方文档翻译-3 testng.xml
  5. python调用tushare获取IPO新股上市列表数据
  6. hud 3183
  7. AForge.Video.FFMPEG库几个注意事项
  8. android应用的资源
  9. jq-demo-点击改变图片
  10. 27 string类中常用的方法列表