You can create your own diagnosis function that can be checked to run when executing the diagnosis tool.
Diagnosis has 3 apis to export data. Each may have different color on the diagnosis result screen.
k.diagnosis.error
For critical error message.
k.diagnosis.warning
For non-critical errors.
k.diagnosis.info
For information only.
Create a diagnosis, name it "mydiagnosis", and enter below to the body
var allpages = k.siteDb.pages.all();
var page = allpages[0];
if (page.body.length> 20000)
{
var error = "Page too long: " + page.name;
k.diagnosis.error(error);
}
Go to the diagnosis tool on main navigation menu, you can find the diagnosis option now.