mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
reorder some struct declarations in profiler
This commit is contained in:
parent
cf4107e262
commit
1d2c038954
1 changed files with 9 additions and 8 deletions
|
@ -52,14 +52,6 @@ pub enum ProfilerCategory {
|
||||||
// FIXME(rust#8803): workaround for lack of CTFE function on enum types to return length
|
// FIXME(rust#8803): workaround for lack of CTFE function on enum types to return length
|
||||||
NumBuckets,
|
NumBuckets,
|
||||||
}
|
}
|
||||||
type ProfilerBuckets = TreeMap<ProfilerCategory, ~[float]>;
|
|
||||||
|
|
||||||
// back end of the profiler that handles data aggregation and performance metrics
|
|
||||||
pub struct Profiler {
|
|
||||||
port: Port<ProfilerMsg>,
|
|
||||||
buckets: ProfilerBuckets,
|
|
||||||
last_msg: Option<ProfilerMsg>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ProfilerCategory {
|
impl ProfilerCategory {
|
||||||
// convenience function to not have to cast every time
|
// convenience function to not have to cast every time
|
||||||
|
@ -99,6 +91,15 @@ impl ProfilerCategory {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ProfilerBuckets = TreeMap<ProfilerCategory, ~[float]>;
|
||||||
|
|
||||||
|
// back end of the profiler that handles data aggregation and performance metrics
|
||||||
|
pub struct Profiler {
|
||||||
|
port: Port<ProfilerMsg>,
|
||||||
|
buckets: ProfilerBuckets,
|
||||||
|
last_msg: Option<ProfilerMsg>,
|
||||||
|
}
|
||||||
|
|
||||||
impl Profiler {
|
impl Profiler {
|
||||||
pub fn create(port: Port<ProfilerMsg>) {
|
pub fn create(port: Port<ProfilerMsg>) {
|
||||||
let port = Cell::new(port);
|
let port = Cell::new(port);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue