Move profiler code from util into a new crate profile.

- Most of util::memory has been moved into profile::mem, though the
  `SizeOf` trait and related things remain in util::memory. The
  `SystemMemoryReporter` code is now in a submodule
  profile::mem::system_reporter.

- util::time has been moved entirely into profile::time.
This commit is contained in:
Nicholas Nethercote 2015-03-23 16:48:54 -07:00
parent cad58b3bec
commit 52447ccd9b
36 changed files with 850 additions and 726 deletions

View file

@ -7,9 +7,7 @@ use resource_task;
use resource_task::{LoadData, ResourceTask};
use resource_task::ProgressMsg::{Payload, Done};
use util::task::spawn_named;
use util::taskpool::TaskPool;
use util::time::{self, profile, TimeProfilerChan};
use profile::time::{self, profile, TimeProfilerChan};
use std::borrow::ToOwned;
use std::collections::HashMap;
use std::collections::hash_map::Entry::{Occupied, Vacant};
@ -17,6 +15,8 @@ use std::mem::replace;
use std::sync::{Arc, Mutex};
use std::sync::mpsc::{channel, Receiver, Sender};
use url::Url;
use util::task::spawn_named;
use util::taskpool::TaskPool;
pub enum Msg {
/// Tell the cache that we may need a particular image soon. Must be posted
@ -495,10 +495,10 @@ mod tests {
use resource_task::ProgressMsg::{Payload, Done};
use sniffer_task;
use image::base::test_image_bin;
use util::taskpool::TaskPool;
use util::time::{TimeProfiler, TimeProfilerChan};
use profile::time::{TimeProfiler, TimeProfilerChan};
use std::sync::mpsc::{Sender, channel, Receiver};
use url::Url;
use util::taskpool::TaskPool;
trait Closure {
fn invoke(&self, _response: Sender<resource_task::ProgressMsg>) { }