Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
0127e662
Commit
0127e662
authored
11 years ago
by
Richard Linden
Browse files
Options
Downloads
Patches
Plain Diff
stat bars with no stats now show n/a instead of o
parent
40a7c63e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/llcommon/lltracerecording.h
+15
-0
15 additions, 0 deletions
indra/llcommon/lltracerecording.h
indra/llui/llstatbar.cpp
+96
-84
96 additions, 84 deletions
indra/llui/llstatbar.cpp
with
111 additions
and
84 deletions
indra/llcommon/lltracerecording.h
+
15
−
0
View file @
0127e662
...
@@ -333,6 +333,21 @@ namespace LLTrace
...
@@ -333,6 +333,21 @@ namespace LLTrace
const
Recording
&
getPrevRecording
(
U32
offset
)
const
;
const
Recording
&
getPrevRecording
(
U32
offset
)
const
;
Recording
snapshotCurRecording
()
const
;
Recording
snapshotCurRecording
()
const
;
template
<
typename
T
>
size_t
getSampleCount
(
const
TraceType
<
T
>&
stat
,
size_t
num_periods
=
U32_MAX
)
{
size_t
total_periods
=
mNumPeriods
;
num_periods
=
llmin
(
num_periods
,
isStarted
()
?
total_periods
-
1
:
total_periods
);
size_t
num_samples
=
0
;
for
(
S32
i
=
1
;
i
<=
num_periods
;
i
++
)
{
S32
index
=
(
mCurPeriod
+
total_periods
-
i
)
%
total_periods
;
num_samples
+=
mRecordingPeriods
[
index
].
getSampleCount
(
stat
);
}
return
num_samples
;
}
//
//
// PERIODIC MIN
// PERIODIC MIN
//
//
...
...
This diff is collapsed.
Click to expand it.
indra/llui/llstatbar.cpp
+
96
−
84
View file @
0127e662
...
@@ -225,6 +225,9 @@ void LLStatBar::draw()
...
@@ -225,6 +225,9 @@ void LLStatBar::draw()
max
=
0
,
max
=
0
,
mean
=
0
;
mean
=
0
;
S32
num_samples
=
0
;
LLLocalClipRect
_
(
getLocalRect
());
LLLocalClipRect
_
(
getLocalRect
());
LLTrace
::
PeriodicRecording
&
frame_recording
=
LLTrace
::
get_frame_recording
();
LLTrace
::
PeriodicRecording
&
frame_recording
=
LLTrace
::
get_frame_recording
();
...
@@ -236,6 +239,7 @@ void LLStatBar::draw()
...
@@ -236,6 +239,7 @@ void LLStatBar::draw()
if
(
mPerSec
)
if
(
mPerSec
)
{
{
unit_label
+=
"/s"
;
unit_label
+=
"/s"
;
num_samples
=
frame_recording
.
getSampleCount
(
*
mCountFloatp
,
mNumFrames
);
current
=
last_frame_recording
.
getPerSec
(
*
mCountFloatp
);
current
=
last_frame_recording
.
getPerSec
(
*
mCountFloatp
);
min
=
frame_recording
.
getPeriodMinPerSec
(
*
mCountFloatp
,
mNumFrames
);
min
=
frame_recording
.
getPeriodMinPerSec
(
*
mCountFloatp
,
mNumFrames
);
max
=
frame_recording
.
getPeriodMaxPerSec
(
*
mCountFloatp
,
mNumFrames
);
max
=
frame_recording
.
getPeriodMaxPerSec
(
*
mCountFloatp
,
mNumFrames
);
...
@@ -243,6 +247,7 @@ void LLStatBar::draw()
...
@@ -243,6 +247,7 @@ void LLStatBar::draw()
}
}
else
else
{
{
num_samples
=
frame_recording
.
getSampleCount
(
*
mCountFloatp
,
mNumFrames
);
current
=
last_frame_recording
.
getSum
(
*
mCountFloatp
);
current
=
last_frame_recording
.
getSum
(
*
mCountFloatp
);
min
=
frame_recording
.
getPeriodMin
(
*
mCountFloatp
,
mNumFrames
);
min
=
frame_recording
.
getPeriodMin
(
*
mCountFloatp
,
mNumFrames
);
max
=
frame_recording
.
getPeriodMax
(
*
mCountFloatp
,
mNumFrames
);
max
=
frame_recording
.
getPeriodMax
(
*
mCountFloatp
,
mNumFrames
);
...
@@ -254,6 +259,7 @@ void LLStatBar::draw()
...
@@ -254,6 +259,7 @@ void LLStatBar::draw()
LLTrace
::
Recording
&
last_frame_recording
=
frame_recording
.
getLastRecording
();
LLTrace
::
Recording
&
last_frame_recording
=
frame_recording
.
getLastRecording
();
unit_label
=
mUnitLabel
.
empty
()
?
mEventFloatp
->
getUnitLabel
()
:
mUnitLabel
;
unit_label
=
mUnitLabel
.
empty
()
?
mEventFloatp
->
getUnitLabel
()
:
mUnitLabel
;
num_samples
=
frame_recording
.
getSampleCount
(
*
mEventFloatp
,
mNumFrames
);
current
=
last_frame_recording
.
getMean
(
*
mEventFloatp
);
current
=
last_frame_recording
.
getMean
(
*
mEventFloatp
);
min
=
frame_recording
.
getPeriodMin
(
*
mEventFloatp
,
mNumFrames
);
min
=
frame_recording
.
getPeriodMin
(
*
mEventFloatp
,
mNumFrames
);
max
=
frame_recording
.
getPeriodMax
(
*
mEventFloatp
,
mNumFrames
);
max
=
frame_recording
.
getPeriodMax
(
*
mEventFloatp
,
mNumFrames
);
...
@@ -264,6 +270,7 @@ void LLStatBar::draw()
...
@@ -264,6 +270,7 @@ void LLStatBar::draw()
LLTrace
::
Recording
&
last_frame_recording
=
frame_recording
.
getLastRecording
();
LLTrace
::
Recording
&
last_frame_recording
=
frame_recording
.
getLastRecording
();
unit_label
=
mUnitLabel
.
empty
()
?
mSampleFloatp
->
getUnitLabel
()
:
mUnitLabel
;
unit_label
=
mUnitLabel
.
empty
()
?
mSampleFloatp
->
getUnitLabel
()
:
mUnitLabel
;
num_samples
=
frame_recording
.
getSampleCount
(
*
mSampleFloatp
,
mNumFrames
);
current
=
last_frame_recording
.
getMean
(
*
mSampleFloatp
);
current
=
last_frame_recording
.
getMean
(
*
mSampleFloatp
);
min
=
frame_recording
.
getPeriodMin
(
*
mSampleFloatp
,
mNumFrames
);
min
=
frame_recording
.
getPeriodMin
(
*
mSampleFloatp
,
mNumFrames
);
max
=
frame_recording
.
getPeriodMax
(
*
mSampleFloatp
,
mNumFrames
);
max
=
frame_recording
.
getPeriodMax
(
*
mSampleFloatp
,
mNumFrames
);
...
@@ -329,7 +336,9 @@ void LLStatBar::draw()
...
@@ -329,7 +336,9 @@ void LLStatBar::draw()
{
{
decimal_digits
=
0
;
decimal_digits
=
0
;
}
}
std
::
string
value_str
=
llformat
(
"%10.*f %s"
,
decimal_digits
,
mean
,
unit_label
.
c_str
());
std
::
string
value_str
=
num_samples
?
llformat
(
"%10.*f %s"
,
decimal_digits
,
mean
,
unit_label
.
c_str
())
:
"n/a"
;
// Draw the current value.
// Draw the current value.
if
(
mOrientation
==
HORIZONTAL
)
if
(
mOrientation
==
HORIZONTAL
)
...
@@ -345,7 +354,8 @@ void LLStatBar::draw()
...
@@ -345,7 +354,8 @@ void LLStatBar::draw()
LLFontGL
::
RIGHT
,
LLFontGL
::
TOP
);
LLFontGL
::
RIGHT
,
LLFontGL
::
TOP
);
}
}
if
(
mDisplayBar
&&
(
mCountFloatp
||
mEventFloatp
||
mSampleFloatp
))
if
(
mDisplayBar
&&
(
mCountFloatp
||
mEventFloatp
||
mSampleFloatp
))
{
{
// Draw the tick marks.
// Draw the tick marks.
LLGLSUIDefault
gls_ui
;
LLGLSUIDefault
gls_ui
;
...
@@ -431,7 +441,6 @@ void LLStatBar::draw()
...
@@ -431,7 +441,6 @@ void LLStatBar::draw()
if
(
begin
<
0
)
if
(
begin
<
0
)
{
{
begin
=
0
;
begin
=
0
;
llwarns
<<
"Min:"
<<
min
<<
llendl
;
}
}
S32
end
=
(
S32
)
((
max
-
mCurMinBar
)
*
value_scale
);
S32
end
=
(
S32
)
((
max
-
mCurMinBar
)
*
value_scale
);
...
@@ -444,6 +453,8 @@ void LLStatBar::draw()
...
@@ -444,6 +453,8 @@ void LLStatBar::draw()
gl_rect_2d
(
begin
,
bar_top
,
end
,
bar_bottom
,
LLColor4
(
1.
f
,
0.
f
,
0.
f
,
0.25
f
));
gl_rect_2d
(
begin
,
bar_top
,
end
,
bar_bottom
,
LLColor4
(
1.
f
,
0.
f
,
0.
f
,
0.25
f
));
}
}
if
(
num_samples
)
{
F32
span
=
(
mOrientation
==
HORIZONTAL
)
F32
span
=
(
mOrientation
==
HORIZONTAL
)
?
(
bar_right
-
bar_left
)
?
(
bar_right
-
bar_left
)
:
(
bar_top
-
bar_bottom
);
:
(
bar_top
-
bar_bottom
);
...
@@ -529,6 +540,7 @@ void LLStatBar::draw()
...
@@ -529,6 +540,7 @@ void LLStatBar::draw()
}
}
}
}
}
}
}
LLView
::
draw
();
LLView
::
draw
();
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment