tianyun пре 3 година
родитељ
комит
842aa9ce9f
3 измењених фајлова са 28 додато и 23 уклоњено
  1. 15 0
      project-test/推荐工具箱测试/tmp.py
  2. 6 16
      sh-demo/tmp.sh
  3. 7 7
      tmp.py

+ 15 - 0
project-test/推荐工具箱测试/tmp.py

@@ -43,3 +43,18 @@ class MyTest(unittest.TestCase):
     # 测试兜底策略
     def test3(self):
         req(1, '', '')
+
+    def test4(self):
+        data = {"name": "p_00x32cx6bo7_count", "data": [
+            {"action_type": "曝光", "session_id": "xx12x@p_00x32cx6bo7\\x0368d1cfc7236659285e932ff64c13e5a8\\x03exp_id",
+             "action_value": "exposure"},
+            {"action_type": "曝光", "session_id": "xx12x@p_00x32cx6bo7\\x0368d1cfc7236659285e932ff64c13e5a8\\x03exp_id",
+             "action_value": "exposure"},
+            {"action_type": "曝光", "session_id": "xx12x@p_00x32cx6bo7\\x0368d1cfc7236659285e932ff64c13e5a8\\x03exp_id",
+             "action_value": "exposure"},
+            {"action_type": "曝光", "session_id": "xx12x@p_00x32cx6bo7\\x0368d1cfc7236659285e932ff64c13e5a8\\x03exp_id",
+             "action_value": "exposure"}]}
+        url = "http://10.20.2.200:31669/api/hao_rec/about_log/log_counter"
+        for x in range(100):
+            res = requests.post(url, json=data)
+            print(res.text)

+ 6 - 16
sh-demo/tmp.sh

@@ -1,16 +1,6 @@
-increment_version ()
-{
-  declare -a part=( ${1//\./ } )
-  declare    new
-  declare -i carry=1
-  for (( CNTR=${#part[@]}-1; CNTR>=0; CNTR-=1 )); do
-    len=${#part[CNTR]}
-    new=$((part[CNTR]+carry))
-    [ ${#new} -gt $len ] && carry=1 || carry=0
-    [ $CNTR -gt 0 ] && part[CNTR]=${new: -len} || part[CNTR]=${new}
-  done
-  new="${part[*]}"
-  echo -e "${new// /.}"
-}
-version='1.2.3.9'
-increment_version $version
+redis_config=''
+if [ -e "/redisconfig/redis.conf" ]; then
+  redis_config="/redisconfig/redis.conf"
+else
+
+fi

+ 7 - 7
tmp.py

@@ -1,8 +1,8 @@
-import requests
+import os
 
-url = "http://192.168.7.229:8089/kafka_api/push_message?slot_id=p_00e43ftehhw"
-body = {"user_id": "200", "action_type": "曝光", "item_id": "1541734",
-        "session_id": "200@p_0iv2ilqfmp6\x0303e8aace6e8bbd70e00348744e6645bc\x03ep_0m2gwghvs37__热门物品",
-        "action_value": "exposure", "ts": 0}
-res = requests.post(url, json=body)
-print(res.json())
+with open("data.csv", "w") as f:
+    f.write("id,name,price1,description,insert_time")
+    f.write(os.linesep)
+    for i in range(480000):
+        f.write(f"{i},苹果,4.25,商品价格,2022-04-19 10:00:00")
+        f.write(os.linesep)