mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 19:57:57 +01:00
Log a warning if a plugin search takes more than 50 milliseconds (#10772)
This commit is contained in:
@@ -186,6 +186,11 @@ namespace PowerLauncher.Plugin
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (milliseconds > 50)
|
||||||
|
{
|
||||||
|
Log.Warn($"PluginManager.QueryForPlugin {metadata.Name}. Query cost - {milliseconds} milliseconds", typeof(PluginManager));
|
||||||
|
}
|
||||||
|
|
||||||
metadata.QueryCount += 1;
|
metadata.QueryCount += 1;
|
||||||
metadata.AvgQueryTime = metadata.QueryCount == 1 ? milliseconds : (metadata.AvgQueryTime + milliseconds) / 2;
|
metadata.AvgQueryTime = metadata.QueryCount == 1 ? milliseconds : (metadata.AvgQueryTime + milliseconds) / 2;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user