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

server: add query stats to hrana responses #1267

Merged
merged 7 commits into from
Apr 11, 2024
Merged

Conversation

LucioFranco
Copy link
Contributor

No description provided.

@LucioFranco LucioFranco requested a review from MarinPostma March 27, 2024 21:02
@invisal
Copy link

invisal commented Mar 30, 2024

Wow. This is game changing feature.

@@ -1026,6 +1026,8 @@ type StmtResult = {
"rows": Array<Array<Value>>,
"affected_row_count": uint32,
"last_insert_rowid": string | null,
"rows_read": uint64,
Copy link
Contributor

Choose a reason for hiding this comment

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

Since affected_row_count is uint32, shouldn't rows_read and rows_written be uint32 as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not following for why it should match the uint32 of affected row count? Is it just to save the 4 extra bytes?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just for consistency. if affected_row_count is uint32 and rows_written is uint64 then it is confusing. Does it mean max affected_row_count is 2^32 and max rows_written is 2^64? Maybe it's fine to have different types for those fields but it is confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lets solve this in a follow up. This feature is still hidden for now. Looks like there is both a uint64 and uint32 api for affected rows.

@LucioFranco LucioFranco requested a review from haaawk April 4, 2024 22:21
@LucioFranco LucioFranco added this pull request to the merge queue Apr 11, 2024
Merged via the queue into main with commit dac888b Apr 11, 2024
17 checks passed
@LucioFranco LucioFranco deleted the lucio/add-query-stats branch April 11, 2024 16:39
shopifyski pushed a commit to Shopify/libsql that referenced this pull request Apr 16, 2024
* server: add query stats to hrana responses

* update spec with stats

* remove unused import

* fix snapshot

* more snapshots

* add stats to legacy api

* address comments
github-merge-queue bot pushed a commit that referenced this pull request Apr 22, 2024
* wip - passing userauthcontext instead of http headers

* revert comment out

* fixed temp change

* Merge branch 'main' into jw/changing-how-jwt-is-passed-around

* fixed failing tests

* next iteration of unit test fixing

* fixed remaining unit tests

* reverted debug

* removed accidentally added file

* moved str to userauthcontext conversion to from trait

* remove vague comment

* cargo fmt

* cleaned up mod reimportss

* refactored cryptic matching in replica_proxy

* marked potentially duplicate code with // todo dupe #auth

* refactored context to custome errors

* added a factory to produce empty UserAuthContext

* added constructors for UserAuthContext

* switched from try_into to using constructors

* cargo fmt

* added tests for failing cases in parsers

* adding mamespace as param wip

* cargo fmt

* added test for non-asci error

* incremental changes to make namespace as param work

* fixed failing test

* fixed log message

* removed unnecessary error mapping

* turned context to result

* removing dummy tokens from tests

* cargo fmt + cleanup

* namespace passing exammple

* added namespace config for the example

* remove unnecessary dummy token

* reverting accidental commit

* deduplicated handling of hrana hello and repreated hello. Code is fully equivalent to the previous form. No change in logic.

* fixed early return

* lazy unwrapping

* made session fields private again

* fmt

* cleaned up nesting in conn

* fmt

* refactored ns selection to be more expressive

* narrowed the type constraints for namespace arg

* restructured namespace_from_headers

* rearranged the logic of selecting namespace passing method

* fmt

* simplified type

* further refinement of namespace selection logic

* reverted unnecessary change

* reverted unnecessary change

* fmt

* added documentation

* Fix simple queries for schema databases (#1285)

* server: release v0.24.5 (#1286)

* libsql: fix embedded replica multiple txn (#1287)

This commit fixes an issue where new connections for embedded replica's
with write delegation would not create a new "connection" on the server
causing weird issues with transactions and state. The fix here is to
create a new `client_id` when creating a new writer for a new connection
locally. This forces the server to use separate connections to execute
the writes.

Closes #1283

* libsql: prepare v0.3.3 release (#1288)

* Go updates (#1289)

* Go bindings: Improve imports

Signed-off-by: Piotr Jastrzebski <[email protected]>

* Go bindings: continue Next() after a time.Time

Signed-off-by: Piotr Jastrzebski <[email protected]>

* Go bindings: remove unused err check

Signed-off-by: Piotr Jastrzebski <[email protected]>

---------

Signed-off-by: Piotr Jastrzebski <[email protected]>

* Remove in-tree version of go-libsql (#1291)

* Go bindings: build only sql-experimental for CI

Signed-off-by: Piotr Jastrzebski <[email protected]>

* Go bindings: Run go-libsql tests in CI

Signed-off-by: Piotr Jastrzebski <[email protected]>

* Go bindings: Remove in-tree version of go-libsql

go-libsql is maintained in https://github.com/tursodatabase/go-libsql

Signed-off-by: Piotr Jastrzebski <[email protected]>

* Go bindings: Run more tests in CI

Signed-off-by: Piotr Jastrzebski <[email protected]>

---------

Signed-off-by: Piotr Jastrzebski <[email protected]>

* don't regen log on sqld version mismatch (#1296)

* add debug info to release build (#1297)

* Add 'aarch64-unknown-linux-gnu' to dist targets (#1295)

* bump sqld v0.24.6 (#1298)

* Bump arm builder machine (#1301)

Builds of arm images are hanging/crashing

* Revert "add debug info to release build (#1297)" (#1300)

This reverts commit 342e4c3.

* bottomless: upgrade s3 sdk to 1.0 (#1302)

* bottomless: upgrade s3 sdk to 1.0

* fix behavior version

* libsql: fix embedded replica example (#1282)

* server: add query stats to hrana responses (#1267)

* server: add query stats to hrana responses

* update spec with stats

* remove unused import

* fix snapshot

* more snapshots

* add stats to legacy api

* address comments

* update tonic to 0.11 (#1308)

* Add workflow_dispatch event trigger for PR images (#1306)

* Fix sync (#1316)

Old implementation could never finish if the write is faster than
time needed to do two round-trips to primary.

For example it's enough to have a write every 200ms to make sync
never finish if it's done in embedded replica in Sydney
if the primary and the writer are in the US.

Signed-off-by: Piotr Jastrzebski <[email protected]>

* server: add `query_duration_ms` stats to query res (#1309)

* server: add `query_duration_ms` stats to query res

* hrana: default new stats fields

* libsql: fix unwraps in local replicas (#1318)

* server: release v0.24.7 (#1320)

* cargo lock update

* Revert "cargo lock update"

This reverts commit a86b89d.

---------

Signed-off-by: Piotr Jastrzebski <[email protected]>
Co-authored-by: Julian <[email protected]>
Co-authored-by: Athos <[email protected]>
Co-authored-by: Lucio Franco <[email protected]>
Co-authored-by: Piotr Jastrzębski <[email protected]>
Co-authored-by: ad hoc <[email protected]>
Co-authored-by: Pekka Enberg <[email protected]>
Co-authored-by: Avinash Sajjanshetty <[email protected]>
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.

3 participants