Skip to content

VRF v2: more prom metrics - #6902

Merged
makramkd merged 15 commits into
developfrom
feature/more-vrf-metrics
Jul 29, 2022
Merged

VRF v2: more prom metrics#6902
makramkd merged 15 commits into
developfrom
feature/more-vrf-metrics

Conversation

@makramkd

@makramkd makramkd commented Jun 29, 2022

Copy link
Copy Markdown
Contributor

This PR adds the following prometheus metrics:

  • How much time elapses for a request while it is in the vrf listener queue in between simulations
  • How much time elapses between a transaction being created in the txm (via CreateTransaction) and being successfully broadcast for the first time (in eth_broadcaster.go)
  • How much time elapses between a transaction being created in the txm (via CreateTransaction) and being confirmed in a block (in eth_confirmer.go)

@github-actions

Copy link
Copy Markdown
Contributor

I see that you haven't updated any CHANGELOG files. Would it make sense to do so?

@github-actions

This comment has been minimized.

Comment on lines +44 to +51
Buckets: []float64{
float64(500 * time.Millisecond),
float64(time.Second),
float64(5 * time.Second),
float64(15 * time.Second),
float64(30 * time.Second),
float64(time.Minute),
float64(2 * time.Minute),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Bucket values here are up for discussion, I wasn't sure what kind of values we'd see.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there an example of another histogram and what the values are there? This is my first time seeing something like this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread core/chains/evm/txmgr/eth_broadcaster.go Outdated
Comment on lines +84 to +94
Buckets: []float64{
float64(500 * time.Millisecond),
float64(time.Second),
float64(5 * time.Second),
float64(15 * time.Second),
float64(30 * time.Second),
float64(time.Minute),
float64(2 * time.Minute),
float64(5 * time.Minute),
float64(10 * time.Minute),
},

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These buckets are up for debate as well.

@github-actions

github-actions Bot commented Jun 30, 2022

Copy link
Copy Markdown
Contributor

EVM Smoke Test Results

52 tests   22 ✔️  6m 56s ⏱️
  1 suites  30 💤
  1 files      0

Results for commit ed91711.

♻️ This comment has been updated with latest results.

Comment thread core/chains/evm/txmgr/eth_broadcaster.go Outdated
Comment thread core/chains/evm/txmgr/eth_confirmer.go Outdated
Comment thread core/utils/utils.go
// MinKey returns the minimum value of the given element array with respect
// to the given key function. In the event U is not a compound type (e.g a
// struct) an identity function can be provided.
func MinKey[U any, T constraints.Ordered](elems []U, key func(U) T) T {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sidenote: methods like this would be very useful to have in a general utility library (honestly, most of the functions in the utils package can probably be safely extracted)

@makramkd
makramkd marked this pull request as ready for review July 11, 2022 15:27
@makramkd
makramkd requested a review from connorwstein as a code owner July 11, 2022 15:27
@makramkd
makramkd requested review from a team, jmank88 and samsondav July 11, 2022 15:27
Comment thread core/services/vrf/listener_v2.go Outdated
@makramkd
makramkd requested a review from vreff July 18, 2022 18:38
Comment thread core/chains/evm/txmgr/eth_broadcaster.go
// Since we can re-enter this method by way of tryAgainBumpingGas,
// and we pass the same initialBroadcastAt timestamp there, when we re-enter
// this function we'll be using the same initialBroadcastAt.
observeTimeUntilBroadcast(eb.chainID, etx.CreatedAt, time.Now())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

at this point the tx has been sent and is in the mempool correct? We are not assuming that at this point there have been any confirmations etc..

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nvm I see below we do confirmations.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep this is just for broadcasting, not for confirming.

@github-actions

github-actions Bot commented Jul 28, 2022

Copy link
Copy Markdown
Contributor

Solana Smoke Test Results

1 tests   1 ✔️  4m 34s ⏱️
1 suites  0 💤
1 files    0

Results for commit ed91711.

♻️ This comment has been updated with latest results.

1. vrf_request_time_between_sims: this will record the duration in
between two simulation attempts of the same request.
2. vrf_request_time_until_initial_sim: this will record the duration
until a request is first simulated after it's been received.
@makramkd
makramkd dismissed samsondav’s stale review July 28, 2022 17:18

Comments addressed.

@makramkd
makramkd requested review from a team and samsondav July 28, 2022 17:19
@makramkd
makramkd merged commit e999911 into develop Jul 29, 2022
@makramkd
makramkd deleted the feature/more-vrf-metrics branch July 29, 2022 19:42
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.

4 participants