Skip to content

[Merged by Bors] - Add perf reporting to client Producer#2424

Closed
tjtelan wants to merge 29 commits intofluvio-community:masterfrom
tjtelan:client-stats
Closed

[Merged by Bors] - Add perf reporting to client Producer#2424
tjtelan wants to merge 29 commits intofluvio-community:masterfrom
tjtelan:client-stats

Conversation

@tjtelan
Copy link
Contributor

@tjtelan tjtelan commented Jun 18, 2022

Resolves #2423

Added ClientStats and ClientStatsUpdate to fluvio crate and integrated into TopicProducer with latency, throughput, memory and cpu stats. This behavior is configurable through TopicProducerConfig using ClientStatsDataCollect enum.

Added user facing ClientStatsDataPoint for display of stats collection. Used in fluvio-cli.

Exposed functionality in the CLI with --stats, --stats-plus, --stats-path options

e.g. fluvio produce <topic> --stats

  • --stats
    • This configures the producer for collecting data for throughput and latency reporting
  • --stats-plus
    • This spawns a separate thread to poll the system for CPU and memory usage.
  • --stats-path
    • When combined with --stats- or --stats-plus, this will write the datapoints to file in csv format for loading into spreadsheet
  • --no-stats-bar
    • Prevent display and update of stats bar. Useful when in combination with --stats-path
  • --stats-summary
    • Implies --stats. Don't print live stats. Only the summary.

@tjtelan tjtelan marked this pull request as ready for review June 22, 2022 04:56
@tjtelan tjtelan requested a review from sehz June 22, 2022 04:56
@tjtelan tjtelan requested a review from sehz June 23, 2022 02:22
@sehz
Copy link

sehz commented Jun 23, 2022

rebase

Copy link

@sehz sehz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few more comments

@tjtelan tjtelan requested a review from sehz June 23, 2022 20:26
@tjtelan tjtelan requested a review from sehz June 25, 2022 02:49
Copy link

@sehz sehz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks very good. Just a couple of nits left.

@sehz
Copy link

sehz commented Jun 25, 2022

Also, need CLI Test to see if the stat is correct.

@sehz
Copy link

sehz commented Jun 28, 2022

rebase

@tjtelan tjtelan requested a review from sehz July 7, 2022 05:13
Copy link

@sehz sehz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks couple. Couple of comments.

Sehyo Chang and others added 9 commits July 7, 2022 21:08
Still pretty raw. Not able to get batch size yet
Moved record update further up the callstack
Figured out how to get compressed size

Wired up consumer to print stats

Nothing updated yet, but good start

Share stats in multipart consumer stream

Created a new PartitionConsumer constructor
Naming is hard

clean up producer measurements
Still need to adjust, but good start

Doing some cleanup
Using the largest reasonable units for quantity

Handle some wasm32 compiler errors

Reverting changes made to consumer for PR
Finish recording details that were unimplemented

Move reporting into cli

Optimize some unnecessary destructures

Bump crate versions

Add to changelog

Trying to remove RwLock dependency for stats

Addressing some PR feedback
Updating the ArcSwap is a little complicated

Address some PR feedback

Address PR feedback
Fixing more batch len during conversion

Add new methods for getting batch length

Hopefully clear up stats collect process
Reorg stats module to be easier to read
It compiles, but not yet tested
tjtelan added 7 commits July 7, 2022 21:09
A little bit of cleanup too
Replaced timestamp using chrono with std::instant
Fixed csv writing
Fixed interactive stats window
@tjtelan tjtelan requested a review from sehz July 8, 2022 04:42
@tjtelan tjtelan requested a review from sehz July 9, 2022 05:43
Copy link

@sehz sehz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nice work

@sehz
Copy link

sehz commented Jul 9, 2022

bors r+

bors bot pushed a commit that referenced this pull request Jul 9, 2022
Resolves #2423 

Added `ClientStats` and `ClientStatsUpdate` to `fluvio` crate and integrated into `TopicProducer` with latency, throughput, memory and cpu stats. This behavior is configurable through `TopicProducerConfig` using  `ClientStatsDataCollect` enum.

Added user facing `ClientStatsDataPoint` for display of stats collection. Used in fluvio-cli.

Exposed functionality in the CLI with `--stats`, `--stats-plus`, `--stats-path` options

e.g. `fluvio produce <topic> --stats`

* `--stats`
  * This configures the producer for collecting data for throughput and latency reporting
* `--stats-plus`
  * This spawns a separate thread to poll the system for CPU and memory usage.
* `--stats-path`
  * When combined with `--stats`- or `--stats-plus`, this will write the datapoints to file in csv format for loading into spreadsheet
* `--no-stats-bar`
  * Prevent display and update of stats bar. Useful when in combination with `--stats-path`
* `--stats-summary`
  * Implies `--stats`. Don't print live stats. Only the summary.

Co-authored-by: T.J. Telan <t.telan@gmail.com>
@bors
Copy link

bors bot commented Jul 9, 2022

Build failed:

@sehz
Copy link

sehz commented Jul 9, 2022

@sehz
Copy link

sehz commented Jul 9, 2022

disable stats for armv7? This probably can be done thru feature flag

Build verified on local

$ cross  build --bin fluvio --release --target armv7-unknown-linux-gnueabihf
   Compiling fluvio v0.13.0 (/project/crates/fluvio)
   Compiling fluvio-extension-common v0.8.0 (/project/crates/fluvio-extension-common)
   Compiling fluvio-cluster v0.0.0 (/project/crates/fluvio-cluster)
   Compiling fluvio-cli v0.0.0 (/project/crates/fluvio-cli)
    Finished release [optimized] target(s) in 1m 01s
@tjtelan
Copy link
Contributor Author

tjtelan commented Jul 9, 2022

disable stats for armv7? This probably can be done thru feature flag

I fixed this by having 32 bit arm use the same types as wasm32. Builds for me now.

$ cross build --bin fluvio --release --target armv7-unknown-linux-gnueabihf
   Compiling fluvio v0.13.0 (/project/crates/fluvio)
   Compiling fluvio-extension-common v0.8.0 (/project/crates/fluvio-extension-common)
   Compiling fluvio-cluster v0.0.0 (/project/crates/fluvio-cluster)
   Compiling fluvio-cli v0.0.0 (/project/crates/fluvio-cli)
    Finished release [optimized] target(s) in 1m 01s

@tjtelan
Copy link
Contributor Author

tjtelan commented Jul 9, 2022

bors r+

bors bot pushed a commit that referenced this pull request Jul 9, 2022
Resolves #2423 

Added `ClientStats` and `ClientStatsUpdate` to `fluvio` crate and integrated into `TopicProducer` with latency, throughput, memory and cpu stats. This behavior is configurable through `TopicProducerConfig` using  `ClientStatsDataCollect` enum.

Added user facing `ClientStatsDataPoint` for display of stats collection. Used in fluvio-cli.

Exposed functionality in the CLI with `--stats`, `--stats-plus`, `--stats-path` options

e.g. `fluvio produce <topic> --stats`

* `--stats`
  * This configures the producer for collecting data for throughput and latency reporting
* `--stats-plus`
  * This spawns a separate thread to poll the system for CPU and memory usage.
* `--stats-path`
  * When combined with `--stats`- or `--stats-plus`, this will write the datapoints to file in csv format for loading into spreadsheet
* `--no-stats-bar`
  * Prevent display and update of stats bar. Useful when in combination with `--stats-path`
* `--stats-summary`
  * Implies `--stats`. Don't print live stats. Only the summary.

Co-authored-by: T.J. Telan <t.telan@gmail.com>
@bors
Copy link

bors bot commented Jul 9, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title Add perf reporting to client Producer [Merged by Bors] - Add perf reporting to client Producer Jul 9, 2022
@bors bors bot closed this Jul 9, 2022
bors bot pushed a commit that referenced this pull request Jul 13, 2022
Fixing a small display bug from ##2424
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add performance-related probes in Producer client

5 participants