Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F35011216
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:37 PM
2022-03-18 16:37:45 (UTC+0)
Size
1 KB
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
if db['Replicas']:
analyzed_db['has replicas'] = True
name = db['Key']['Hostname'] + ':' + str(db['Key']['Port'])
analyzed_db['name'] = name
if db['Problems']:
analyzed_db['problems'] = db['Problems']
if db['Key']['Port'] != 3306:
analyzed_db['multiinstace'] = True
analyzed_db['binlog format'] = db['Binlog_format']
analyzed_db['position'] = '{}:{}'.format(db['ExecBinlogCoordinates']['LogFile'], 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
9377677
Default Alt Text
raw-paste-data.txt (1 KB)
Attached To
Mode
P22832 (An Untitled Masterwork)
Attached
Detach File
Event Timeline
Log In to Comment