Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F35008762
Orch anlayze POC
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
Ladsgroup
Mar 16 2022, 2:11 PM
2022-03-16 14:11:41 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
Orch anlayze POC
View Options
function report(section) {
let fetchRes = fetch("https://orchestrator.wikimedia.org/api/cluster/alias/" + section);
fetchRes.then(res =>
res.json()).then(d => {
let db_data = [];
for (let i = 0, len = d.length; i < len; i++) {
let db = d[i];
if (db.Key.Hostname.startsWith('dbstore')) {
// let's not promote dbstore to master
continue;
}
if (db.MasterKey.Hostname + ':' + db.MasterKey.Port != db.ClusterName) {
// Not a direct replica
continue;
}
if (db.Replicas.length) {
// Has replicas already, don't do it
continue;
}
let name = db.Key.Hostname + ':' + db.Key.Port;
db_data_name = {name: name};
if (db.Problems) {
db_data_name.Problems = db.Problems;
}
db_data_name.multiinstace = db.Key.Port != 3306;
db_data_name.position = db.ExecBinlogCoordinates.LogPos;
db_data.push(db_data_name);
}
db_data.sort(function(a, b){return b.position-a.position});
for (let i = 0, len = d.length; i < len; i++) {
console.log(db_data[i]);
}
});
}
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
9376031
Default Alt Text
Orch anlayze POC (1 KB)
Attached To
Mode
P22613 Orch anlayze POC
Attached
Detach File
Event Timeline
Log In to Comment