12345678910111213141516171819202122232425262728293031323334353637383940 |
- """
- @author: luojunhui
- """
- import json
- import time
- import requests
- from concurrent.futures.thread import ThreadPoolExecutor
- def score_list(account):
- """
- url = "http://192.168.100.31:8179/score_list"
- url1 = "http://47.98.154.124:6060/score_list"
- # url1 = "http://localhost:6060/score_list"
- url2 = "http://192.168.100.31:6062/score_list"
- :param account:
- :return:
- """
- url2 = "http://192.168.100.31:6062/score_list"
- body = {
- "account_nickname_list": [account],
- "text_list": ['保姆为300万拆迁款,嫁给大24岁老头,丈夫去世后,她发现房产证没有丈夫名字'] * 50,
- "max_time": None,
- "min_time": None,
- "interest_type": "avg",
- "sim_type": "mean",
- "rate": 0.1
- }
- response = requests.post(url=url2, headers={}, json=body).json()
- print(json.dumps(response, ensure_ascii=False, indent=4))
- return response
- if __name__ == '__main__':
- a = time.time()
- with ThreadPoolExecutor(max_workers=100) as pool:
- pool.map(score_list, ["生活良读"] * 1000)
- b = time.time()
- print(b - a)
|