<commit_before>﻿using RenderingLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Threading;

namespace PerformanceMeasurementPlugin.ViewModels
{
    public class PerformanceViewModel : INotifyPropertyChanged
    {
        DispatcherTimer mTimer;

        public int DrawCallCount
        {
            get
            {
                return SystemManagers.Default.Renderer.DrawCalls;
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        public PerformanceViewModel()
        {
            mTimer = new DispatcherTimer();
            mTimer.Tick += HandleTick;
            mTimer.Interval = TimeSpan.FromSeconds(1);

            mTimer.Start();
        }

        private void HandleTick(object sender, EventArgs e)
        {
            if(PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs("DrawCallCount"));
            }
        }


    }
}<commit_msg>Fixed a NullReferenceException in PerformanceMeasurementPlugin<commit_after>﻿using RenderingLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Threading;

namespace PerformanceMeasurementPlugin.ViewModels
{
    public class PerformanceViewModel : INotifyPropertyChanged
    {
        DispatcherTimer mTimer;

        public int DrawCallCount
        {
            get
            {
                if (SystemManagers.Default != null)
                {
                    return SystemManagers.Default.Renderer.DrawCalls;
                }
                else
                {
                    return 0;
                }
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        public PerformanceViewModel()
        {
            mTimer = new DispatcherTimer();
            mTimer.Tick += HandleTick;
            mTimer.Interval = TimeSpan.FromSeconds(1);

            mTimer.Start();
        }

        private void HandleTick(object sender, EventArgs e)
        {
            if(PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs("DrawCallCount"));
            }
        }


    }
}
{'fraction_non_alphanumeric': 0.06928213689482471, 'fraction_numerical': 0.0012520868113522537, 'mean_word_length': 1.863799283154122, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2495706', 'n_tokens_mistral': 580, 'n_tokens_neox': 552, 'n_words': 120}