aboutsummaryrefslogtreecommitdiffstats
path: root/components/util/time.rs
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2014-10-22 14:45:35 -0600
committerbors-servo <metajack+bors@gmail.com>2014-10-22 14:45:35 -0600
commita6f0159cb85e3b84a826c41ae5ad1b6aea09d7cc (patch)
tree9d7e5c319003b7b3c759d8fdf426baa322776a1b /components/util/time.rs
parent1bc9c049c6536bc102939fd97f4390eed3dcc2bf (diff)
parentd2d012165f45d285002193b484ae8edbd8fda95f (diff)
downloadservo-a6f0159cb85e3b84a826c41ae5ad1b6aea09d7cc.tar.gz
servo-a6f0159cb85e3b84a826c41ae5ad1b6aea09d7cc.zip
auto merge of #3765 : pcwalton/servo/profiler-cleanups, r=cgaebel
The only real user-visible change this effects is to trim URLs to 30 characters so they don't make huge lines on the terminal. r? @cgaebel
Diffstat (limited to 'components/util/time.rs')
-rw-r--r--components/util/time.rs17
1 files changed, 11 insertions, 6 deletions
diff --git a/components/util/time.rs b/components/util/time.rs
index 596b8931be2..232e73b3802 100644
--- a/components/util/time.rs
+++ b/components/util/time.rs
@@ -27,9 +27,9 @@ impl TimeProfilerChan {
#[deriving(PartialEq, Clone, PartialOrd, Eq, Ord)]
pub struct TimerMetadata {
- url: String,
- iframe: bool,
- first_reflow: bool,
+ url: String,
+ iframe: bool,
+ incremental: bool,
}
pub trait Formatable {
@@ -42,9 +42,14 @@ impl Formatable for Option<TimerMetadata> {
// TODO(cgaebel): Center-align in the format strings as soon as rustc supports it.
&Some(ref meta) => {
let url = meta.url.as_slice();
- let first_reflow = if meta.first_reflow { " yes" } else { " no " };
+ let url = if url.len() > 30 {
+ url.slice_to(30)
+ } else {
+ url
+ };
+ let incremental = if meta.incremental { " yes" } else { " no " };
let iframe = if meta.iframe { " yes" } else { " no " };
- format!(" {:14} {:9} {:30}", first_reflow, iframe, url)
+ format!(" {:14} {:9} {:30}", incremental, iframe, url)
},
&None =>
format!(" {:14} {:9} {:30}", " N/A", " N/A", " N/A")
@@ -256,7 +261,7 @@ pub fn profile<T>(category: TimeProfilerCategory,
TimerMetadata {
url: url.serialize(),
iframe: iframe,
- first_reflow: first_reflow,
+ incremental: !first_reflow,
});
time_profiler_chan.send(TimeMsg((category, meta), ms));
return val;