You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-76Lines changed: 39 additions & 76 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,82 +18,45 @@ The ambi_mock_client repository makes use of several Git hooks to ensure that co
18
18
19
19
This will create symlinks to the Git hooks, preserving any hooks that you may have already configured.
20
20
21
-
### Using cargo run
22
-
```BASH
23
-
> cargo build
24
-
> cargo run
25
-
26
-
Sending POST request to http://localhost:4000/api/readings/add as JSON: {"tempurature":"19.2","humidity":"87.7","pressure":"1074","dust_concentration":"415","air_purity":"DANGEROUS"}
You can either install this as a CLI tool by running `cargo install --path .` (which is the
24
+
recommended way of using this) or you can run it directly from this repository.
25
+
26
+
```
27
+
# Installed
28
+
$ ambi_mock_client -h
29
+
30
+
# Or not Installed
31
+
$ cargo run -- -h
32
+
33
+
# Output
34
+
Provides a mock Ambi client that emulates real sensor hardware such as an Edge client.
35
+
36
+
Usage: ambi_mock_client [OPTIONS]
37
+
38
+
Options:
39
+
-d, --debug
40
+
Turns verbose console debug output on
41
+
-n, --post-amount <POST_AMOUNT>
42
+
The number of sensor readings to post. [DEFAULT: 1]
43
+
-t, --time-per-post <TIME_PER_POST_S>
44
+
The time between each sensor reading post (in seconds). [DEFAULT: 10]
45
+
-T, --total-time <TOTAL_TIME_S>
46
+
The total time over which all the sensor reading posts must be sent (in seconds, alternative to -t)
47
+
-p, --num-threads <NUM_THREADS>
48
+
The number of threads to spawn. The workload will be cloned to each thread, not divided. [DEFAULT: 1]
49
+
-h, --help
50
+
Print help (see more with '--help')
51
+
-V, --version
52
+
Print version
61
53
```
62
54
63
-
### As an executable binary
64
-
```BASH
65
-
> cargo build
66
-
> ./target/debug/ambi_mock_client
67
-
68
-
Sending POST request to http://localhost:4000/api/readings/add as JSON: {"tempurature":"28.8","humidity":"85.2","pressure":"964","dust_concentration":"930","air_purity":"DANGEROUS"}
0 commit comments