PageRenderTime 305ms CodeModel.GetById 189ms app.highlight 19ms RepoModel.GetById 80ms app.codeStats 0ms

/indra/newview/llfasttimerview.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 97 lines | 59 code | 13 blank | 25 comment | 0 complexity | 0cfade31ad01679c3ced6837635ca21a MD5 | raw file
 1/** 
 2 * @file llfasttimerview.h
 3 * @brief LLFastTimerView class definition
 4 *
 5 * $LicenseInfo:firstyear=2004&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#ifndef LL_LLFASTTIMERVIEW_H
28#define LL_LLFASTTIMERVIEW_H
29
30#include "llfloater.h"
31#include "llfasttimer.h"
32
33class LLFastTimerView : public LLFloater
34{
35public:
36	LLFastTimerView(const LLSD&);
37	BOOL postBuild();
38
39	static BOOL sAnalyzePerformance;
40
41	static void outputAllMetrics();
42	static void doAnalysis(std::string baseline, std::string target, std::string output);
43
44private:
45	static void doAnalysisDefault(std::string baseline, std::string target, std::string output) ;
46	static LLSD analyzePerformanceLogDefault(std::istream& is) ;
47	static void exportCharts(const std::string& base, const std::string& target);
48	void onPause();
49
50public:
51
52	virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
53	virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
54	virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
55	virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
56	virtual BOOL handleHover(S32 x, S32 y, MASK mask);
57	virtual BOOL handleToolTip(S32 x, S32 y, MASK mask);
58	virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
59	virtual void draw();
60
61	LLFastTimer::NamedTimer* getLegendID(S32 y);
62	F64 getTime(const std::string& name);
63
64protected:
65	virtual	void	onClickCloseBtn();
66private:	
67	typedef std::vector<std::vector<S32> > bar_positions_t;
68	bar_positions_t mBarStart;
69	bar_positions_t mBarEnd;
70	S32 mDisplayMode;
71
72	typedef enum child_alignment
73	{
74		ALIGN_LEFT,
75		ALIGN_CENTER,
76		ALIGN_RIGHT,
77		ALIGN_COUNT
78	} ChildAlignment;
79
80	ChildAlignment mDisplayCenter;
81	S32 mDisplayCalls;
82	S32 mDisplayHz;
83	U64 mAvgCountTotal;
84	U64 mMaxCountTotal;
85	LLRect mBarRect;
86	S32	mScrollIndex;
87	LLFastTimer::NamedTimer* mHoverID;
88	LLFastTimer::NamedTimer* mHoverTimer;
89	LLRect					mToolTipRect;
90	S32 mHoverBarIndex;
91	LLFrameTimer mHighlightTimer;
92	S32 mPrintStats;
93	S32 mAverageCyclesPerTimer;
94	LLRect mGraphRect;
95};
96
97#endif