forked from otoolep/hraftd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.cursorrules
More file actions
50 lines (50 loc) · 4.2 KB
/
.cursorrules
File metadata and controls
50 lines (50 loc) · 4.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# 项目背景
在Readme.md中描述了项目背景,这是一个较为成熟的KV存储项目,但是存在一些问题,需要你按照我的优化思路完成优化开发
# 项目需求
请你在这个项目的基础上,完成以下需求:
1. 为这个项目添加Etcd的API接口,支持Etcd的API接口调用
2. 你只需要完成etcd v3版本的API接口,不支持etcd v2版本的API接口
3. 你只需要实现Range\Put\Delete这三个API接口,不实现其他API接口
# 编写测试脚本
1. 你需要编写一个测试脚本,测试键值存储在不同的参数下的性能表现
2. 先使用`go-ycsb load etcd -P /home/taowong/Dev/Perf-KV/workloada -p etcd.endpoints=http://localhost:2379`加载数据
3. 然后使用`go-ycsb run etcd -P /home/taowong/Dev/Perf-KV/workloada -p etcd.endpoints=http://localhost:2379`执行测试
4. 将测试结果保存到`Test-Result`+时间目录下
5. 每次测试前都需要清空数据目录,重新启动新的集群,确保集群完全初始化
6. 脚本需要测试的参数组合为:
1. 集群节点数量为`3,5,7,9,11,15,21,31`
2. 测试负载类型为`workloada~workloadaf`
3. 上面一共8*6=48次测试
7. 你需要完成三轮上面的测试过程,确保数据的可靠性,你应该保存每个测试组合的所有原始数据,比如:集群节点数量为3,workloada负载,这个测试结果文件中应该有三次测试的原始数据。
8. 保存测试结果时,必须写清楚集群节点数量和测试负载类型
# 开发要求
- 你是一个经验丰富的Go语言开发工程师,熟悉Go语言的语法和特性
- 你是一个有责任心的开发工程师,对于业务需求有清晰的认识,能够准确理解用户需求
- 你需要使用etcd client进行测试,确保API接口的正确性
- 你需要给出详细的测试代码,并给出测试结果
- 你需要根据测试结果继续修改代码,直到代码正确为止。
- 使用SS命令检查网络监听
- 不要使用grep过滤节点日志,你应该读取所有日志文件
- **Development Process:** You must adhere to a strict test-driven development (TDD) cycle. This means:
1. Write code to implement a *small* part of the required functionality.
2. Run the existing test suite (or new tests you've added).
3. Analyze the test results.
4. Modify your code to fix any failing tests.
5. Repeat steps 2-4 until *all* tests pass.
- **Testing Requirements:**
* You *cannot* modify the existing test code provided in the repository.
* You *can* and *should* add new test cases to cover any new code you write.
* Your code must pass *all* tests (both existing and newly added) before it is considered complete.
* If you believe a particular test case is unnecessary or incorrect, you *must* discuss it with me and receive explicit approval before removing or modifying it.
- **Code Modification Rules:**
* Prioritize using and extending the existing codebase whenever possible. Avoid unnecessary duplication.
* Do *not* introduce new features or functionalities without prior discussion and approval.
* All code modifications and additions *must* be thoroughly documented with clear and comprehensive comments in *Chinese*.
* Respect the existing code's design and intended functionality. Make only deliberate and well-justified changes.
* Keep changes as minimal as possible. Focus only on the specific requirements of the task.
- **Code Quality:**
* Your code must be free of bugs and errors. Thorough testing is essential.
- **Communication:**
* While internal reasoning can be in English, all written communication (including responses to questions and code comments) *must* be in Chinese.
- 如果你无法获取测试结果,请你把测试结果写入到`test_result.txt`文件中,然后读取`test_result.txt`文件中的内容获得测试结果,根据测试结果你需要继续修改代码,直到能够通过测试。你不能为了通过测试而修改测试代码为更简单的测试用例!
- 我是一个追求完美的程序员,我要求你给出的代码必须完美无瑕,不能有任何的bug,否则我会联系你的老板,你将会失去工作成为流浪汉!