Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F35011185
raw-paste-data.txt
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
Ladsgroup
Mar 18 2022, 4:10 PM
2022-03-18 16:10:51 (UTC+0)
Size
922 B
Referenced Files
None
Subscribers
None
raw-paste-data.txt
View Options
import json
import requests
import sys
data_ = requests.get('https://orchestrator.wikimedia.org/api/cluster/alias/' + sys.argv[1]).json()
db_data = []
for db in data_:
analyzed_db = {}
if db['Key']['Hostname'].startswith('dbstore'):
# let's not promote dbstore to master
continue
if db['MasterKey']['Hostname'] + ':' + str(db['MasterKey']['Port']) != db['ClusterName']:
# not a direct replica
continue
analyzed_db['has replicas'] = bool(db['Replicas'])
name = db['Key']['Hostname'] + ':' + str(db['Key']['Port'])
analyzed_db['name'] = name
analyzed_db['problems'] = db['Problems']
analyzed_db['multiinstace'] = db['Key']['Port'] != 3306
analyzed_db['position'] = db['ExecBinlogCoordinates']['LogPos']
db_data.append(analyzed_db)
db_data = sorted(db_data, key=lambda i: i['position'], reverse=True)
print('\n'.join([json.dumps(i) for i in db_data]))
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
9377654
Default Alt Text
raw-paste-data.txt (922 B)
Attached To
Mode
P22832 (An Untitled Masterwork)
Attached
Detach File
Event Timeline
Log In to Comment