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

Add an EpochSyncTime table #621

Closed
erikd opened this issue May 28, 2021 · 1 comment
Closed

Add an EpochSyncTime table #621

erikd opened this issue May 28, 2021 · 1 comment

Comments

@erikd
Copy link
Contributor

erikd commented May 28, 2021

This is mainly for measuring sync performance.

It would require a simple table like:

    EpochSyncTime
      no               Word64
      seconds          Double Maybe

Basiically we need an IORef or TMVar containing a Maybe UTCTime. On db-sync startup this mutable variable is set to Nothing. Then, on each LedgerNewEpoch event it retrieves the old value of the mutable variable and replaces it with the current time. If the old value is Nothing it writes Nothing to the seconds field of the table above. If old value is not Nothing the time in the mutable variable is subtracted from the current time and tihe difference in seconds written to the database.

One very minor gotcha that needs to be fixed first. Currently a LedgerNewEpoch event is generated erroniously on db-sync program start up. This would need to be suppressed for the above to give correct results.

@erikd
Copy link
Contributor Author

erikd commented May 29, 2021

It is probably a good idea to add a status field (Syncing vs Following) and maybe even an era field (eg Byron, Shelley, Allegra, etc).

erikd added a commit that referenced this issue May 31, 2021
This table is mainly for sync time performance validation. Different
machines are likley to have different results in this table.

Closes: #621
erikd added a commit that referenced this issue May 31, 2021
This table is mainly for sync time performance validation. Different
machines are likley to have different results in this table.

Closes: #621
erikd added a commit that referenced this issue May 31, 2021
This table is mainly for sync time performance validation. Different
machines are likley to have different results in this table.

Closes: #621
@erikd erikd closed this as completed in 07e81b6 May 31, 2021
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

No branches or pull requests

1 participant