Profile refactor
This commit is contained in:
parent
5fe7b87215
commit
bb366ba457
1 changed files with 13 additions and 13 deletions
|
@ -7,22 +7,22 @@ namespace Ryujinx.Profiler
|
||||||
public static class Profile
|
public static class Profile
|
||||||
{
|
{
|
||||||
// Static
|
// Static
|
||||||
private static InternalProfile ProfileInstance;
|
private static InternalProfile _profileInstance;
|
||||||
private static ProfilerSettings Settings;
|
private static ProfilerSettings _settings;
|
||||||
|
|
||||||
public static bool ProfilingEnabled()
|
public static bool ProfilingEnabled()
|
||||||
{
|
{
|
||||||
if (!Settings.Enabled)
|
if (!_settings.Enabled)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (ProfileInstance == null)
|
if (_profileInstance == null)
|
||||||
ProfileInstance = new InternalProfile();
|
_profileInstance = new InternalProfile();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Configure(ProfilerSettings settings)
|
public static void Configure(ProfilerSettings settings)
|
||||||
{
|
{
|
||||||
Settings = settings;
|
_settings = settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void FinishProfiling()
|
public static void FinishProfiling()
|
||||||
|
@ -30,22 +30,22 @@ namespace Ryujinx.Profiler
|
||||||
if (!ProfilingEnabled())
|
if (!ProfilingEnabled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Settings.FileDumpEnabled)
|
if (_settings.FileDumpEnabled)
|
||||||
DumpProfile.ToFile(Settings.DumpLocation, ProfileInstance);
|
DumpProfile.ToFile(_settings.DumpLocation, _profileInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Begin(ProfileConfig config)
|
public static void Begin(ProfileConfig config)
|
||||||
{
|
{
|
||||||
if (!ProfilingEnabled())
|
if (!ProfilingEnabled())
|
||||||
return;
|
return;
|
||||||
ProfileInstance.BeginProfile(config);
|
_profileInstance.BeginProfile(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void End(ProfileConfig config)
|
public static void End(ProfileConfig config)
|
||||||
{
|
{
|
||||||
if (!ProfilingEnabled())
|
if (!ProfilingEnabled())
|
||||||
return;
|
return;
|
||||||
ProfileInstance.EndProfile(config);
|
_profileInstance.EndProfile(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Method(ProfileConfig config, Action method)
|
public static void Method(ProfileConfig config, Action method)
|
||||||
|
@ -63,7 +63,7 @@ namespace Ryujinx.Profiler
|
||||||
{
|
{
|
||||||
if (!ProfilingEnabled())
|
if (!ProfilingEnabled())
|
||||||
return null;
|
return null;
|
||||||
return ProfileInstance.GetSession();
|
return _profileInstance.GetSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double ConvertTicksToMS(long ticks)
|
public static double ConvertTicksToMS(long ticks)
|
||||||
|
@ -75,12 +75,12 @@ namespace Ryujinx.Profiler
|
||||||
{
|
{
|
||||||
if (!ProfilingEnabled())
|
if (!ProfilingEnabled())
|
||||||
return new Dictionary<ProfileConfig, TimingInfo>();
|
return new Dictionary<ProfileConfig, TimingInfo>();
|
||||||
return ProfileInstance.GetProfilingData();
|
return _profileInstance.GetProfilingData();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float GetUpdateRate()
|
public static float GetUpdateRate()
|
||||||
{
|
{
|
||||||
return Settings.UpdateRate;
|
return _settings.UpdateRate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue