mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Add filter to plugin stats window draw and framework times (#1244)
Co-authored-by: nebel <nebel@users.noreply.github.com>
This commit is contained in:
parent
9e139389ea
commit
b9101a55e8
1 changed files with 27 additions and 0 deletions
|
|
@ -23,6 +23,8 @@ namespace Dalamud.Interface.Internal.Windows;
|
|||
internal class PluginStatWindow : Window
|
||||
{
|
||||
private bool showDalamudHooks;
|
||||
private string drawSearchText = string.Empty;
|
||||
private string frameworkSearchText = string.Empty;
|
||||
private string hookSearchText = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -79,6 +81,12 @@ internal class PluginStatWindow : Window
|
|||
ImGui.SameLine();
|
||||
ImGuiComponents.TextWithLabel("Collective Average", $"{(loadedPlugins.Any() ? totalAverage / loadedPlugins.Count() / 10000f : 0):F4}ms", "Average of all average draw times");
|
||||
|
||||
ImGui.InputTextWithHint(
|
||||
"###PluginStatWindow_DrawSearch",
|
||||
"Search",
|
||||
ref this.drawSearchText,
|
||||
500);
|
||||
|
||||
if (ImGui.BeginTable(
|
||||
"##PluginStatsDrawTimes",
|
||||
4,
|
||||
|
|
@ -114,6 +122,12 @@ internal class PluginStatWindow : Window
|
|||
|
||||
foreach (var plugin in loadedPlugins)
|
||||
{
|
||||
if (!this.drawSearchText.IsNullOrEmpty()
|
||||
&& !plugin.Manifest.Name.Contains(this.drawSearchText, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
ImGui.TableNextRow();
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
|
|
@ -168,6 +182,12 @@ internal class PluginStatWindow : Window
|
|||
ImGui.SameLine();
|
||||
ImGuiComponents.TextWithLabel("Collective Average", $"{(statsHistory.Any() ? totalAverage / statsHistory.Length : 0):F4}ms", "Average of all average update times");
|
||||
|
||||
ImGui.InputTextWithHint(
|
||||
"###PluginStatWindow_FrameworkSearch",
|
||||
"Search",
|
||||
ref this.frameworkSearchText,
|
||||
500);
|
||||
|
||||
if (ImGui.BeginTable(
|
||||
"##PluginStatsFrameworkTimes",
|
||||
4,
|
||||
|
|
@ -208,6 +228,13 @@ internal class PluginStatWindow : Window
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!this.frameworkSearchText.IsNullOrEmpty()
|
||||
&& handlerHistory.Key != null
|
||||
&& !handlerHistory.Key.Contains(this.frameworkSearchText, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
ImGui.TableNextRow();
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue