This file contains hidden or 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
# post_loc.txt contains the json you want to post | |
# -p means to POST it | |
# -H adds an Auth header (could be Basic or Token) | |
# -T sets the Content-Type | |
# -c is concurrent clients | |
# -n is the number of requests to run in the test | |
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/ |
This file contains hidden or 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
CREATE OR REPLACE FUNCTION generate_object_id() RETURNS varchar AS $$ | |
DECLARE | |
time_component bigint; | |
machine_id int := FLOOR(random() * 16777215); | |
process_id int; | |
seq_id bigint := FLOOR(random() * 16777215); | |
result varchar:= ''; | |
BEGIN | |
SELECT FLOOR(EXTRACT(EPOCH FROM clock_timestamp())) INTO time_component; | |
SELECT pg_backend_pid() INTO process_id; |
NewerOlder