Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

依赖

  • Python 3.7+
  • pymysql
  • DBUtils
  • pyyaml

配置

请在 setting.yaml 中填写数据库连接信息,例如:

db:
  host: "your-mariadb-host"
  port: 3306
  user: "your-username"
  password: "your-password"
  database: "your-database"
db_pool:
  mincached: 2
  maxcached: 5
process_num: 3

Docker 使用

  1. 构建镜像

    docker build -t dbwrite-test .
  2. 运行容器

    docker run -v $(pwd)/setting.yaml:/app/setting.yaml dbwrite-test

    你也可以直接修改镜像内的 setting.yaml。

本地运行

  1. 安装依赖

    pip install -r requirements.txt
    # 或手动安装
    pip install pymysql DBUtils pyyaml
  2. 启动多进程写入测试

    python worker.py

说明

  • 所有数据库操作均通过 util/db_utils.py 实现,支持连接池。
  • 进程数等参数可在 setting.yaml 配置。
  • 你可以根据需要修改 pkg/mariadb/ 下的测试逻辑。

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages