<commit_before>package flixel.system.debug;

import flash.display.Graphics;
import flash.display.Shape;
import flash.geom.Rectangle;
import flash.system.System;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.text.TextFormatAlign;
import flixel.FlxG;
import flixel.system.FlxAssets;
import flixel.system.FlxList;
import flixel.system.FlxQuadTree;
import flixel.util.FlxMath;

#if flash
import flash.text.AntiAliasType;
import flash.text.GridFitType;
#end

/**
 * A simple performance monitor widget, for use in the debugger overlay.
 * 
 * @author Adam "Atomic" Saltsman
 * @author <NAME>
 */
class Stats extends Window
{
	private static inline var UPDATE_DELAY:Int = 500;
	private static inline var WIDTH:Int = 450;
	
	public var minFps:Float;
	public var maxFps:Float;
	public var minMem:Float;
	public var maxMem:Float;
	private var history:Int = 60;
	
	private var fpsList:Array<Float>;
	private var memList:Array<Float>;
	
	private var _itvTime:Int = 0;
	private var _initTime:Int;
	private var _frameCount:Int;
	private var _totalCount:Int;
	private var _currentTime:Int;
	
	private var _tfMaxFps:TextField;
	private var _tfMinFps:TextField;
	private var _tfMaxMem:TextField;
	private var _tfMinMem:TextField;
	private var _tfInfo:TextField;
	
	private var _fpsBox:Shape;
	private var _memBox:Shape;
	private var _display:Shape;
	
	private var _defaultFormat:TextFormat;
	
	private var flashPlayerFramerate:Float = 0;
	private var visibleCount:Int = 0;
	private var activeCount:Int = 0;
	private var updateTime:Int = 0;
	private var drawTime:Int = 0;
	
	private var _lastTime:Int = 0;
	private var _updateTimer:Int = 0;
	
	private var _update:Array<Int>;
	private var _updateMarker:Int = 0;
	
	private var _draw:Array<Int>;
	private var _drawMarker:Int = 0;
	
	private var _visibleObject:Array<Int>;
	private var _visibleObjectMarker:Int = 0;
	
	private var _activeObject:Array<Int>;
	private var _activeObjectMarker:Int = 0;
	
	#if !flash
	private var drawCallsCount:Int = 0;
	private var _drawCalls:Array<Int>;
	private var _drawCallsMarker:Int = 0;
	#end
	
	/**
	 * Creates flashPlayerFramerate new window object.  This Flash-based class is mainly (only?) used by <code>FlxDebugger</code>.
	 * @param 	Title		The name of the window, displayed in the header bar.
	 * @param	IconPath	Path to the icon to use for the window header.
	 * @param 	Width		The initial width of the window.
	 * @param 	Height		The initial height of the window.
	 * @param 	Resizable	Whether you can change the size of the window with flashPlayerFramerate drag handle.
	 * @param 	Bounds		A rectangle indicating the valid screen area for the window.
	 */
	public function new(Title:String, ?IconPath:String, Width:Float, Height:Float, Resizable:Bool = true, ?Bounds:Rectangle)
	{
		super(Title, IconPath, Width, Height, Resizable, Bounds);
		
		resize(WIDTH, 170);
		
		fpsList = [];
		memList = [];
		
		_defaultFormat = new TextFormat(FlxAssets.FONT_DEBUGGER, 12, 0xffffff);
		
		_tfMaxFps = makeLabel(2, 15, _defaultFormat);
		addChild(_tfMaxFps);
		
		_tfMinFps = makeLabel(2, 52, _defaultFormat);
		addChild(_tfMinFps);
		
		_tfMaxMem = makeLabel(2, 78, _defaultFormat);
		addChild(_tfMaxMem);
		
		_tfMinMem = makeLabel(2, 115, _defaultFormat);
		addChild(_tfMinMem);
		
		_tfInfo = makeLabel(57, 132, _defaultFormat);
		_tfInfo.multiline = true;
		_tfInfo.height = 32;
		_tfInfo.width = _width;
		addChild(_tfInfo);<commit_msg>a little bit smaller new stats window<commit_after>package flixel.system.debug;

import flash.display.Graphics;
import flash.display.Shape;
import flash.geom.Rectangle;
import flash.system.System;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.text.TextFormatAlign;
import flixel.FlxG;
import flixel.system.FlxAssets;
import flixel.system.FlxList;
import flixel.system.FlxQuadTree;
import flixel.util.FlxMath;

#if flash
import flash.text.AntiAliasType;
import flash.text.GridFitType;
#end

/**
 * A simple performance monitor widget, for use in the debugger overlay.
 * 
 * @author Adam "Atomic" Saltsman
 * @author <NAME>
 */
class Stats extends Window
{
	private static inline var UPDATE_DELAY:Int = 500;
	private static inline var WIDTH:Int = 400;
	
	public var minFps:Float;
	public var maxFps:Float;
	public var minMem:Float;
	public var maxMem:Float;
	private var history:Int = 60;
	
	private var fpsList:Array<Float>;
	private var memList:Array<Float>;
	
	private var _itvTime:Int = 0;
	private var _initTime:Int;
	private var _frameCount:Int;
	private var _totalCount:Int;
	private var _currentTime:Int;
	
	private var _tfMaxFps:TextField;
	private var _tfMinFps:TextField;
	private var _tfMaxMem:TextField;
	private var _tfMinMem:TextField;
	private var _tfInfo:TextField;
	
	private var _fpsBox:Shape;
	private var _memBox:Shape;
	private var _display:Shape;
	
	private var _defaultFormat:TextFormat;
	
	private var flashPlayerFramerate:Float = 0;
	private var visibleCount:Int = 0;
	private var activeCount:Int = 0;
	private var updateTime:Int = 0;
	private var drawTime:Int = 0;
	
	private var _lastTime:Int = 0;
	private var _updateTimer:Int = 0;
	
	private var _update:Array<Int>;
	private var _updateMarker:Int = 0;
	
	private var _draw:Array<Int>;
	private var _drawMarker:Int = 0;
	
	private var _visibleObject:Array<Int>;
	private var _visibleObjectMarker:Int = 0;
	
	private var _activeObject:Array<Int>;
	private var _activeObjectMarker:Int = 0;
	
	#if !flash
	private var drawCallsCount:Int = 0;
	private var _drawCalls:Array<Int>;
	private var _drawCallsMarker:Int = 0;
	#end
	
	/**
	 * Creates flashPlayerFramerate new window object.  This Flash-based class is mainly (only?) used by <code>FlxDebugger</code>.
	 * @param 	Title		The name of the window, displayed in the header bar.
	 * @param	IconPath	Path to the icon to use for the window header.
	 * @param 	Width		The initial width of the window.
	 * @param 	Height		The initial height of the window.
	 * @param 	Resizable	Whether you can change the size of the window with flashPlayerFramerate drag handle.
	 * @param 	Bounds		A rectangle indicating the valid screen area for the window.
	 */
	public function new(Title:String, ?IconPath:String, Width:Float, Height:Float, Resizable:Bool = true, ?Bounds:Rectangle)
	{
		super(Title, IconPath, Width, Height, Resizable, Bounds);
		
		resize(WIDTH, 170);
		
		fpsList = [];
		memList = [];
		
		_defaultFormat = new TextFormat(FlxAssets.FONT_DEBUGGER, 12, 0xffffff);
		
		_tfMaxFps = makeLabel(2, 15, _defaultFormat);
		addChild(_tfMaxFps);
		
		_tfMinFps = makeLabel(2, 52, _defaultFormat);
		addChild(_tfMinFps);
		
		_tfMaxMem = makeLabel(2, 78, _defaultFormat);
		addChild(_tfMaxMem);
		
		_tfMinMem = makeLabel(2, 115, _defaultFormat);
		addChild(_tfMinMem);
		
		_tfInfo = makeLabel(2, 132, _defaultFormat);
		_tfInfo.multiline = true;
		_tfInfo.height = 32;
		_tfInfo.width = _width;
		addChild(_tfInfo);
{'fraction_non_alphanumeric': 0.09184412574243082, 'fraction_numerical': 0.013762132406200204, 'mean_word_length': 4.710504549214226, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '3684657', 'n_tokens_mistral': 2520, 'n_tokens_neox': 2254, 'n_words': 679}