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
CONFIG: | |
import http from "k6/http"; | |
import { check } from "k6"; | |
import { Rate } from "k6/metrics"; | |
export let errorRate = new Rate("errors"); | |
export let options = { | |
thresholds: { |
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
CONFIG: | |
import http from "k6/http"; | |
import { check } from "k6"; | |
import { Rate } from "k6/metrics"; | |
export let errorRate = new Rate("errors"); | |
export let options = { | |
thresholds: { |
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
Config: | |
import http from "k6/http"; | |
import { check } from "k6"; | |
import { Rate } from "k6/metrics"; | |
export let errorRate = new Rate("errors"); | |
export let options = { | |
thresholds: { |
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
\\\\\\\\\\\\\\\\\\\\\\ | |
\\\\POSTGRES \\\\\\\\\ | |
\\\\\\\\\\\\\\\\\\\\\\ | |
GET THE INFORMATION FOR A LISTING INCLUDING ALL OF ITS PHOTOS: | |
First, parition for the location and price of a given id: | |
select * from geninfo where listingid = 9999999; | |
listingid | location | price | reviewcount | rating | title |
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
One- retrieves all the data for a randomly choosen listing within database. | |
Data returned from localhost:300/one | |
{ | |
"_id": "5da0c44225ef4dad666c8e52", | |
"__v": 0, | |
"listingId": 4, | |
"Rating": 5, |
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
var findValue = (node, targetVal) => { | |
var result = false; | |
var accVal = node.value; | |
var checkNodes = (node) => { | |
if (!node.children) { | |
if (accVal === targetVal) { | |
result = true; | |
return; |
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
/* | |
an array of arrays | |
n number of arrays | |
if its over | |
/* |