Skip to content

Commit

Permalink
Log a warning if a plugin search takes more than 50 milliseconds (#10772
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mykhailopylyp committed Apr 19, 2021
1 parent 6e65f9c commit a92c18f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/modules/launcher/PowerLauncher/Plugin/PluginManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@ public static List<Result> QueryForPlugin(PluginPair pair, Query query, bool del
}
});

if (milliseconds > 50)
{
Log.Warn($"PluginManager.QueryForPlugin {metadata.Name}. Query cost - {milliseconds} milliseconds", typeof(PluginManager));
}

metadata.QueryCount += 1;
metadata.AvgQueryTime = metadata.QueryCount == 1 ? milliseconds : (metadata.AvgQueryTime + milliseconds) / 2;

Expand Down

0 comments on commit a92c18f

Please sign in to comment.