Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rakyll/spannerz
Google Cloud Spanner Query Planner Visualizer
https://github.com/rakyll/spannerz
google-cloud google-cloud-platform google-cloud-spanner query-planner
Last synced: 3 days ago
JSON representation
Google Cloud Spanner Query Planner Visualizer
- Host: GitHub
- URL: https://github.com/rakyll/spannerz
- Owner: rakyll
- License: apache-2.0
- Created: 2020-03-12T03:31:56.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-05T23:29:18.000Z (over 4 years ago)
- Last Synced: 2024-08-04T01:15:21.804Z (3 months ago)
- Topics: google-cloud, google-cloud-platform, google-cloud-spanner, query-planner
- Language: Go
- Homepage:
- Size: 24.4 KB
- Stars: 58
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-spanner - spannerz - Query planner visualizer that also provides introspection tools for Go programs. (Tools / ORM)
README
# spannerz
spannerz adds an HTTP handler to your binary
to report query plans from [Google Cloud Spanner](http://cloud.google.com/spanner) clients.
You can use spannerz as a standalone binary too.**NOTE**: You need [Graphviz](https://www.graphviz.org/) installed for visualization features.
## Goals
* Allow users to investigate their client setup in production without having to redeploy new versions.
* Allow users to run a visualizer outside of Google Cloud Console.## Usage
Standalone binary:
```
$ go get -u github.com/rakyll/spannerz
$ spannerz -db projects/PROJECT/instances/SPANNER_INSTANCE/databases/SPANNER_DB
```HTTP handler:
``` go
import (
"cloud.google.com/go/spanner"
"github.com/rakyll/spannerz/spannerz"
)client, err := spanner.NewClient(ctx, "projects/PROJECT/instances/SPANNER_INSTANCE/databases/SPANNER_DB")
if err != nil {
log.Fatalf("Cannot create Spanner client: %v", err)
}
http.Handle("/spannerz", &spannerz.Handler{
Client: client,
})
log.Fatal(http.ListenAndServe(":9090", nil))
```![Screenshot](https://i.imgur.com/06XVWjh.png)
## Roadmap
* Allow running only the query planner without executing the query.
* Support different optimizer versions.
* Support partition queries.
* Support read/write transactions, we currently support read-only ones.## Disclaimer
This is not an official Google product.