原创 Pycharm配置Gitee,自己的練習代碼也可以版本管理 下載安裝 Git 註冊並配置Gitee 項目的上傳和下載

Git 是大家熟悉的代碼版本管理工具,在 GitHub 和 GitLab 上可以託管自己的代碼。 但是上面兩個網站我們始終訪問太慢,所以可以通過國內的 Gitee 等站點來託管自己的練習代碼。 本片文章主要梳理一下如何進行相關的配置,讓你通

原创 Prometheus + Grafana 在 CentOS 中搭建可視化性能監控平臺 Prometheus 部署 Prometheus + Grafana 附錄:問題

Prometheus Prometheus ,由谷歌研發的一款開源的監控軟件。 Prometheus 是一款基於時序數據庫的開源監控告警系統,通過安裝在遠程機器上的 exporter 收集數據並通過HTTP協議從遠程的機器上獲取數據,最後存

原创 Locust 官方文檔 10:將 Locust 作爲庫來使用 3# Full example 完整示例

It’s possible to use Locust as a library, instead of running Locust using the locust command. 將 Locust 作爲 Python 的一個三方庫,

原创 Locust 官方文檔 12:使用無頭模式運行

You can run locust without the web UI - for example if you want to run it in some automated flow, like a CI server - by

原创 Locust 官方文檔 9:擴展 Locust

Locust comes with a number of events hooks that can be used to extend Locust in different ways. Locust 提供了很多的 events hoo

原创 Locust 官方文檔 4:配置運行選項

Command Line Options The most straight forward way to Configure how Locust is run is through command line arguments. 配置

原创 Locust 官方文檔 8:提取測試統計信息爲 CSV 格式

You may wish to consume your Locust results via a CSV file. In this case, there are two ways to do this. 你可能需要將 Locust 結

原创 Locust 官方文檔 7:以逐步加載模式運行

If you want to monitor your service performance with different user load and probe the max tps that can be achieved, you

原创 Locust 官方文檔 5:分佈式執行

雖然 Locust 通過協程可以實現單機大量併發,但是對多核 CPU 的支持並不好,可以通過在一臺機器上啓動多個 Locust 實例實現對多核 CPU 的利用(單機分佈式)。 Once a single machine isn’t en

原创 Locust 官方文檔 6:使用更快的 HTTP 客戶端提高 Locust 性能

Locust’s default HTTP client uses python-requests. Locust 默認的 HTTP 客戶端使用 python-requests. The reason for this is that re

原创 Locust 官方文檔 3: 編寫一個 locustfile

locustfile.py 是 locust 運行的腳本文件,就像 jmeter 的 jmx 文件一樣。 locustfile 是普通的 python 文件。 唯一的要求是它聲明至少一個類,我們稱之爲用戶類屬於User的子類。 用戶類 Us

原创 HTTPRunner 3 用戶手冊 (5) 測試報告

HTTPrunner 集成了 pytest,所以 HTTPrunner v3.x 可以使用 pytest 的所有插件,包括測試報告插件,例如pytest-html 和alluer-pytest。 HTML 測試報告 HTTPrunner 安

原创 HTTPRunner 3 用戶手冊 (4) 運行用例

準備好測試用例後,可以使用hrun命令運行測試用例。 注意,hrun是 httprunner run 的命令別名,具有相同的效果。 $ hrun = httprunner run 注意:目前最新版 3.1.0 版本,測試文件命名不能

原创 HTTPRunner 3 用戶手冊 (3) 編寫用例

HttpRunner v3.x 支持三種測試用例格式,即 pytest,YAML 和 JSON。 強烈建議以 pytest 格式而不是以前的 YAML/JSON 格式編寫和維護測試用例。 格式關係如下圖所示: 記錄並生成測試用例 如果

原创 HTTPRunner 3 用戶手冊 (2) 錄製用例

在編寫測試用例之前,我們應該瞭解 API 的詳細信息。使用 Web 調試代理工具(如Charles,Fiddler)捕獲 HTTP 是一個不錯的選擇。 httprunner 提供一個命令行工具har2case,用於將抓包工具導出的 har