Skip to content

Commit

Permalink
fix: stop must be call to get results when no duration is asked
Browse files Browse the repository at this point in the history
Fixes #2
  • Loading branch information
metacosm committed Oct 24, 2023
1 parent d3be4a2 commit 67bb49a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
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,7 @@ 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

0 comments on commit 67bb49a

Please sign in to comment.