Skip to content

Commit 7d093c9

Browse files
committed
Add chronosphere and resy play
1 parent 047b5b7 commit 7d093c9

13 files changed

Lines changed: 11195 additions & 0 deletions

chronosphere/a

Lines changed: 10695 additions & 0 deletions
Large diffs are not rendered by default.

chronosphere/b

Lines changed: 9 additions & 0 deletions
Large diffs are not rendered by default.

chronosphere/test_dash2.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
api_version: v1/config
2+
kind: ClassicDashboard
3+
spec:
4+
name: Azure Resources 3
5+
slug: azure-resources-3
6+
collection_slug: exocompute-monitoring
7+
dashboard_json: |
8+
{
9+
"title": "Terei Testing",
10+
"description": "Testing chronoctl",
11+
"panels": [
12+
{
13+
"title": "Total Exoclusters Count",
14+
"description": "Total number of Exoclusters live",
15+
"type": "stat",
16+
"datasource": null,
17+
"targets": [
18+
{
19+
"expr": "count(count by (exocompute_id) (last_over_time(spark_exocompute_azure_resource_properties:last{}[4h])))"
20+
}
21+
]
22+
}
23+
]
24+
}

chronosphere/test_dashboard.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
title: "Terei Testing"
2+
description: "Testing chronoctl"
3+
layout: "classic"
4+
collection_slug: "exocompute-monitoring"
5+
panels:
6+
- title: "Total Exoclusters Count"
7+
description: "Total number of Exoclusters live"
8+
type: "stat"
9+
datasource: null
10+
query: "count(count by (exocompute_id) (last_over_time(spark_exocompute_azure_resource_properties:last{}[4h])))"

resy/Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
MAIN=main.py
2+
3+
all: run
4+
5+
setup:
6+
poetry install
7+
8+
build:
9+
poetry build
10+
11+
run:
12+
poetry run python $(MAIN)
13+
14+
format:
15+
poetry run isort $(MAIN)
16+
poetry run yapf -i -p $(MAIN)
17+
18+
check:
19+
poetry run mypy --strict $(MAIN)

resy/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Resy Booker
2+
3+
Book resy!

resy/main.py

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import urllib.request
2+
import time
3+
4+
# from bs4 import BeautifulSoup
5+
from selenium import webdriver
6+
from selenium.webdriver.chrome.options import Options
7+
from selenium.webdriver.common.by import By
8+
from selenium.webdriver.support import expected_conditions as EC
9+
from selenium.webdriver.support.wait import WebDriverWait
10+
11+
12+
# setup selenium
13+
opts = Options()
14+
opts.add_argument('--headless')
15+
driver = webdriver.Chrome(options=opts)
16+
driver.set_window_size(1500,1000)
17+
18+
# get resy homepage
19+
driver.get('https://resy.com')
20+
# soup_file = driver.page_source
21+
# soup = BeautifulSoup(soup_file, features="html.parser")
22+
# print(soup.title.get_text())
23+
24+
# click login button
25+
buttons = driver.find_elements(By.XPATH, '//button[text()="Log in"]')
26+
assert(len(buttons) == 1)
27+
b = buttons[0]
28+
b.click()
29+
WebDriverWait(driver, 10).until(
30+
EC.element_to_be_clickable((By.XPATH, '//button[text()="Use Email and Password instead"]'))
31+
)
32+
driver.save_screenshot('shots_login_1.png')
33+
34+
# click 'email & password' button
35+
buttons = driver.find_elements(By.XPATH, '//button[text()="Use Email and Password instead"]')
36+
assert(len(buttons) == 1)
37+
b = buttons[0]
38+
b.click()
39+
time.sleep(2)
40+
driver.save_screenshot('shots_login_2.png')
41+
42+
# fill in login info
43+
field_email = driver.find_elements(By.ID, 'email')
44+
field_passw = driver.find_elements(By.ID, 'password')
45+
assert(len(field_email) == 1)
46+
assert(len(field_passw) == 1)
47+
48+
field_email[0].send_keys('resy@davidterei.com')
49+
field_passw[0].send_keys('Nedisgay')
50+
51+
# login
52+
buttons = driver.find_elements(By.XPATH, '//button[text()="Continue"]')
53+
assert(len(buttons) == 1)
54+
b = buttons[0]
55+
b.click()
56+
time.sleep(2)
57+
driver.save_screenshot('shots_login_3.png')
58+
59+
# print session
60+
print(driver.get_cookies())
61+
62+
# browse to TATIANA page
63+
driver.get('https://resy.com/cities/ny/tatiana')
64+
time.sleep(1)
65+
driver.save_screenshot('shots_tatiana.png')
66+
67+
driver.quit()

resy/poetry.lock

Lines changed: 352 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resy/pyproject.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[tool.poetry]
2+
name = "resy"
3+
version = "0.1.0"
4+
description = "My resy booker"
5+
authors = ["David Terei <code@davidterei.com>"]
6+
license = "MIT"
7+
readme = "README.md"
8+
9+
[tool.poetry.dependencies]
10+
python = "^3.8"
11+
beautifulsoup4 = "^4.12.2"
12+
selenium = "^4.9.0"
13+
14+
[build-system]
15+
requires = ["poetry-core"]
16+
build-backend = "poetry.core.masonry.api"

resy/shots_login_1.png

582 KB
Loading

0 commit comments

Comments
 (0)