/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const result = await fetchJson(url); if (!result || !result.results) { thrownew Error(`Failed to fetch pushes for ${project} on ${targetDate}`);
}
let pushes = result.results;
console.log(`Found ${pushes.length} pushes for ${targetDate}`);
if (pushes.length < MIN_PUSHES) {
console.log(
`Found fewer than ${MIN_PUSHES} pushes for ${targetDate}, fetching recent pushes...`
); const recentUrl = `${baseUrl}&count=${MIN_PUSHES}&push_timestamp__lte=${endTimestamp}`; const recentResult = await fetchJson(recentUrl); if (recentResult && recentResult.results) { for (const push of recentResult.results) { if (!pushes.find(p => p.id === push.id)) {
pushes.push(push);
}
}
console.log(
`Now have ${pushes.length} pushes after including recent history`
);
}
if (pushes.length < MIN_PUSHES) { thrownew Error(
`Could only find ${pushes.length} pushes, need at least ${MIN_PUSHES}`
);
}
}
return pushes;
}
async function fetchTestJobsForPush(project, pushId) {
let allJobs = [];
let propertyNames = [];
let url = `https://treeherder.mozilla.org/api/jobs/?push_id=${pushId}`;
while (url) { const result = await fetchJson(url); if (!result) { thrownew Error(`Failed to fetch jobs for push ID ${pushId}`);
}
if (!text) { const url = `${TASKCLUSTER_BASE_URL}/api/queue/v1/task/${getTaskPath(job.taskId, job.retryId)}/artifacts/public/test_info/${artifactName}`;
text = await fetchText(url); if (!text) { const artifacts = await listTaskArtifacts(job.taskId, job.retryId); const errorsummaryLogs = artifacts.filter(a =>
a.endsWith("errorsummary.log")
);
if (errorsummaryLogs.length) {
console.error(
`Error fetching ${artifactName} for ${job.name} (${taskString}): Not found, but task has: ${errorsummaryLogs.join(", ")}`
);
} else {
console.error(
`Error fetching ${artifactName} for ${job.name} (${taskString}): Not found (task has no errorsummary logs)`
);
} returnnull;
}
const tables = {
manifest: { array: [], map: new Map() },
jobName: { array: [], map: new Map() },
commit: { array: [], map: new Map() },
prefix: { array: [], map: new Map() },
};
function getId(tableName, value) { const table = tables[tableName];
let id = table.map.get(value); if (id === undefined) {
id = table.array.length;
table.array.push(value);
table.map.set(value, id);
} return id;
}
const testJobs = []; for (const push of pushes) {
console.log(`Collecting jobs from push ${push.id}...`); const jobs = await fetchTestJobsForPush(REPOSITORY, push.id); for (const job of jobs) {
testJobs.push({ ...job, commit: push.revision });
}
}
console.log(`\nFetching errorsummary logs for ${testJobs.length} jobs...`);
const CONCURRENCY = 50; const jobQueue = [...testJobs];
let completedJobs = 0;
let lastPrintTime = 0;
async function processJob(job) { const prefix = getArtifactPrefix(job.name); if (!prefix) {
completedJobs++; return;
}
if (durations.length === 0) { thrownew Error( "No manifest timing data collected. Aborting to avoid overwriting previous data with empty results."
);
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.4Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.