From a4c7ba5c5fe6da7548106601ec5622e6a7693d55 Mon Sep 17 00:00:00 2001 From: 63846d858c742721fa5a7f94 <63846d858c742721fa5a7f94@devide> Date: Thu, 20 Apr 2023 03:07:32 +0000 Subject: [PATCH] UPDATE --- __pycache__/main.cpython-38.pyc | Bin 0 -> 1208 bytes main.py | 31 ++++++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 __pycache__/main.cpython-38.pyc diff --git a/__pycache__/main.cpython-38.pyc b/__pycache__/main.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..186fc847c0b640451552824992fc6e3d71cea443 GIT binary patch literal 1208 zcmb7CJ8u&~5Z>K;t>YNEa3B>*Lt#X0Avy%e0tu)rq!1xp!RhSX*ca}_?mEU6R8Gr( zNXm#mL%l5x`3tF-xx;a=T*4gEbu52tOnIoKvcdaUe>#xHx(1x#7!x*+1Hk}3{RoUCAr&NK zf(mv@LZ=1;@I2wIsPIK_N>()V1;=4_8z;P!)A%GQ)R;np^+6v9A+O-m+h7bVze1P< zD%o(^&?Z*qA)E_py;3E)0ms!cJ-Q$YS-tA?RZ*D!yM>t+c|VJjyjLzPFY>6W#T<<@ z2wm=M0_m+Y{tpq?rYI4R@}Z~VXmCbtn&8=>>Rgm92-c%JH%AxcCGLN1JOV{ERD^WE z`AUw-F-4+<^PPPI+JP8%ct!iKyVUw8QYA-=F0=kPO=NDYGm)mtR0B$_qon>9TXPgA zViuM0L_TgqQjL!-cdy~wNE&tn%cCfdGZ{s8D~hs0%u@8Xqv-Q2PV0XZzMjI372;Qj zePedT5R#)jFi4t4!x?wDSE4ccvh0{j}eo&*!~ro8Gv{lHVZX;SX;xCnV>q@&&iOuSjs83z^DZEAIP?1rz?4`wcrp?~|(cWK;?(Og6nCG`b?KZ7n zS18nk0^l{XHkhe2O-4^_TO>Lj!Bfm*l_&W`S1VL=tKBRswDt8u8=2jP+wy1iTfRV| R^&K!Bito{GwF6E${R6vO2(ADC literal 0 HcmV?d00001 diff --git a/main.py b/main.py index 4c0c135..d95f2c4 100644 --- a/main.py +++ b/main.py @@ -1 +1,30 @@ -print('欢迎来到 InsCode') \ No newline at end of file +from locust import HttpUser, TaskSet, task +import urllib3 + + +urllib3.disable_warnings() + + +class UserBehavior(TaskSet): + + def on_start(self): + print("start****") + + def on_stop(self): + print("stop****") + + @task(1) + def baidu_page1(self): + res = self.client.get("/", verify=False) + + +class WebsiteUser(HttpUser): + tasks = [UserBehavior] + host = "https://www.baidu.com" + min_wait = 1000 + max_wait = 2000 + + +if __name__ == '__main__': + import os + os.system("locust -f main.py --host=https://www.baidu.com") \ No newline at end of file -- GitLab