aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Debugger/Profiler/ProfilerConfiguration.cs
blob: 73ef8f55552866dac323096ee70fd63e816b36d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using Ryujinx.Common.Utilities;
using System.IO;

namespace Ryujinx.Debugger.Profiler
{
    public class ProfilerConfiguration
    {
        public bool   Enabled    { get; private set; }
        public string DumpPath   { get; private set; }
        public float  UpdateRate { get; private set; }
        public int    MaxLevel   { get; private set; }
        public int    MaxFlags   { get; private set; }
        public float  History    { get; private set; }

        /// <summary>
        /// Loads a configuration file from disk
        /// </summary>
        /// <param name="path">The path to the JSON configuration file</param>
        public static ProfilerConfiguration Load(string path)
        {
            if (!File.Exists(path))
            {
                throw new FileNotFoundException($"Profiler configuration file {path} not found");
            }

            return JsonHelper.DeserializeFromFile<ProfilerConfiguration>(path);
        }
    }
}