Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: stop must be called to get results when no duration is asked #3

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ To use the extension:
4. Start your application in dev mode: `quarkus dev`
5. Enter the dev mode terminal by pressing `:` (column)
6. You should have a new `power` command available, type `power --help` for more information
7. You can start power measurement with `power start` and stop it with `power stop`
7. You can start power measurement with `power start` and stop it with `power stop`, at which time the power consumption
of your app will be displayed.
8. You can also ask for power to be measured for a given duration by using the `--duration` option when
calling `power start`. In this case, there's no need to call `power stop`, the energy consumed during the specified
time will be automatically displayed once the time period is elapsed.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public CommandResult execute(CommandInvocation commandInvocation) {
if (duration > 0) {
commandInvocation.println("Measuring power for " + duration + " seconds, every " + frequency + " milliseconds");
} else {
commandInvocation.println("Measuring power until 'stop' is called, every " + frequency + " milliseconds");
commandInvocation.println("Measuring power every " + frequency
+ " milliseconds. Execute 'power stop' to stop measurements and get the results.");
}
sensor.start(duration, frequency, commandInvocation::println);
} catch (Exception e) {
Expand Down
Loading