ProfilerConfiguration.cs 973 B

1234567891011121314151617181920212223242526272829
  1. using Ryujinx.Common.Utilities;
  2. using System.IO;
  3. namespace Ryujinx.Debugger.Profiler
  4. {
  5. public class ProfilerConfiguration
  6. {
  7. public bool Enabled { get; private set; }
  8. public string DumpPath { get; private set; }
  9. public float UpdateRate { get; private set; }
  10. public int MaxLevel { get; private set; }
  11. public int MaxFlags { get; private set; }
  12. public float History { get; private set; }
  13. /// <summary>
  14. /// Loads a configuration file from disk
  15. /// </summary>
  16. /// <param name="path">The path to the JSON configuration file</param>
  17. public static ProfilerConfiguration Load(string path)
  18. {
  19. if (!File.Exists(path))
  20. {
  21. throw new FileNotFoundException($"Profiler configuration file {path} not found");
  22. }
  23. return JsonHelper.DeserializeFromFile<ProfilerConfiguration>(path);
  24. }
  25. }
  26. }