-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into pg_autodiscovery
- Loading branch information
Showing
256 changed files
with
32,641 additions
and
3,315 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# E2E | ||
|
||
## Populate `cockroachdb.sql.*` metrics | ||
|
||
You may want to populate the `cockroachdb.sql` metrics for development purposes or for generating sample data such as for a dashboard. Included in the `/tests/docker/` directory is a SQL script, `sql.sh`, that runs various SQL commands on a loop. To run this script, enable the E2E cockroachdb container by doing the following: `POPULATE_METRICS="true" ddev env start cockroachdb py3.9-22.1` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ services: | |
ports: | ||
- "26257:26257" | ||
- "8080:8080" | ||
volumes: | ||
- ./sql.sh:/sql.sh | ||
networks: | ||
- roachnet | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
# SQL script that performs SELECT, INSERT, CREATE, DELETE commands on a loop in cockroachdb. | ||
# See /tests/README.md. | ||
|
||
echo Wait for servers to be up | ||
sleep 10 | ||
|
||
HOSTPARAMS="--host cockroachdb --insecure" | ||
SQL="/cockroach/cockroach.sh sql $HOSTPARAMS" | ||
|
||
while : | ||
do | ||
$SQL --watch 1m -e """ | ||
CREATE DATABASE IF NOT EXISTS places; | ||
CREATE TABLE IF NOT EXISTS cities ( | ||
id UUID NOT NULL DEFAULT gen_random_uuid(), | ||
city STRING NOT NULL, | ||
country STRING NOT NULL, | ||
population INT8 NOT NULL, | ||
CONSTRAINT \"primary\" PRIMARY KEY (city ASC, ID ASC) | ||
); | ||
INSERT INTO cities (city, country, population) VALUES ('New York City', 'USA', 8804190), ('Boston', 'USA', 654776), ('Madrid', 'Spain', 6975017), ('Paris', 'France', 2206488); | ||
SELECT * FROM cities; | ||
CREATE INDEX IF NOT EXISTS city_idx ON cities (city DESC); | ||
UPDATE cities SET population=10000000 WHERE city = 'New York City'; | ||
INSERT INTO cities (city, country, population) VALUES ('Nowhere', 'USA', 0); | ||
SELECT city FROM cities WHERE population > 0; | ||
DELETE FROM cities WHERE city = 'Nowhere'; | ||
DROP TABLE cities; | ||
SELECT * from fake_table; | ||
""" | ||
|
||
random_num=$(( $RANDOM % 300 + 60 )) | ||
|
||
if [ $(random_num % 2) -gt 275 ]; then | ||
$SQL -e "SELECT * from fake_table;" | ||
fi | ||
|
||
echo Sleeping... | ||
sleep random_num | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.