Skip to content

Commit d25e003

Browse files
andjo403michaelwoerister
authored andcommitted
run cargo fmt
1 parent 9c6f5c6 commit d25e003

File tree

9 files changed

+25
-18
lines changed

9 files changed

+25
-18
lines changed

analyzeme/benches/serialization_bench.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
extern crate test;
44

5-
use measureme::{FileSerializationSink, MmapSerializationSink};
65
use analyzeme::testing_common;
6+
use measureme::{FileSerializationSink, MmapSerializationSink};
77

88
#[bench]
99
fn bench_file_serialization_sink(bencher: &mut test::Bencher) {

analyzeme/tests/serialization.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use measureme::{FileSerializationSink, MmapSerializationSink};
21
use analyzeme::testing_common::run_end_to_end_serialization_test;
2+
use measureme::{FileSerializationSink, MmapSerializationSink};
33

44
#[test]
55
fn test_file_serialization_sink() {

crox/src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ fn generate_thread_to_collapsed_thread_mapping(
6161

6262
if opt.collapse_threads {
6363
// collect start and end times for all threads
64-
let mut thread_start_and_end: FxHashMap<u64, (SystemTime, SystemTime)> = FxHashMap::default();
64+
let mut thread_start_and_end: FxHashMap<u64, (SystemTime, SystemTime)> =
65+
FxHashMap::default();
6566
for event in data.iter() {
6667
thread_start_and_end
6768
.entry(event.thread_id)

flamegraph/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ use std::fs::File;
33
use std::io::BufWriter;
44
use std::path::PathBuf;
55

6+
use analyzeme::{collapse_stacks, ProfilingData};
67
use inferno::flamegraph::{from_lines, Options as FlamegraphOptions};
78
use structopt::StructOpt;
8-
use analyzeme::{collapse_stacks, ProfilingData};
99

1010
#[derive(StructOpt, Debug)]
1111
struct Opt {

mmview/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
use analyzeme::ProfilingData;
12
use std::error::Error;
23
use std::path::PathBuf;
3-
use analyzeme::ProfilingData;
44

55
use structopt::StructOpt;
66

stack_collapse/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use std::fs::File;
33
use std::io::{BufWriter, Write};
44
use std::path::PathBuf;
55

6-
use structopt::StructOpt;
76
use analyzeme::{collapse_stacks, ProfilingData};
7+
use structopt::StructOpt;
88

99
#[derive(StructOpt, Debug)]
1010
struct Opt {

summarize/src/analysis.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use crate::query_data::{QueryData, Results};
2+
use analyzeme::{Event, ProfilingData, Timestamp};
23
use measureme::rustc::*;
34
use rustc_hash::FxHashMap;
45
use std::borrow::Cow;
56
use std::time::SystemTime;
6-
use analyzeme::{Event, ProfilingData, Timestamp};
77

88
/// Collects accumulated summary data for the given ProfilingData.
99
///
@@ -109,7 +109,6 @@ use analyzeme::{Event, ProfilingData, Timestamp};
109109
/// In this case when we encounter `e2`, the stack is `[e1, e3, e4]`, and both
110110
/// `e4` and `e3` need to be popped in the same step.
111111
pub fn perform_analysis(data: ProfilingData) -> Results {
112-
113112
struct PerThreadState<'a> {
114113
stack: Vec<Event<'a>>,
115114
start: SystemTime,
@@ -141,13 +140,14 @@ pub fn perform_analysis(data: ProfilingData) -> Results {
141140
}
142141
Timestamp::Interval { start, end } => {
143142
// This is an interval event
144-
let thread = threads.entry(current_event.thread_id).or_insert_with(|| {
145-
PerThreadState {
146-
stack: Vec::new(),
147-
start,
148-
end,
149-
}
150-
});
143+
let thread =
144+
threads
145+
.entry(current_event.thread_id)
146+
.or_insert_with(|| PerThreadState {
147+
stack: Vec::new(),
148+
start,
149+
end,
150+
});
151151

152152
// Pop all events from the stack that are not parents of the
153153
// current event.
@@ -207,7 +207,10 @@ pub fn perform_analysis(data: ProfilingData) -> Results {
207207
}
208208
}
209209

210-
let total_time = threads.values().map(|t| t.end.duration_since(t.start).unwrap()).sum();
210+
let total_time = threads
211+
.values()
212+
.map(|t| t.end.duration_since(t.start).unwrap())
213+
.sum();
211214

212215
Results {
213216
query_data: query_data.drain().map(|(_, value)| value).collect(),

summarize/src/diff.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ pub fn calculate_diff(base: Results, change: Results) -> DiffResults {
2828
let base_data = build_query_lookup(&base.query_data);
2929
let change_data = build_query_lookup(&change.query_data);
3030

31-
let mut all_labels = FxHashSet::with_capacity_and_hasher(base.query_data.len() + change.query_data.len(), Default::default());
31+
let mut all_labels = FxHashSet::with_capacity_and_hasher(
32+
base.query_data.len() + change.query_data.len(),
33+
Default::default(),
34+
);
3235
for query_data in base.query_data.iter().chain(&change.query_data) {
3336
all_labels.insert(&query_data.label[..]);
3437
}

summarize/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#[macro_use]
22
extern crate prettytable;
33

4+
use analyzeme::ProfilingData;
45
use std::error::Error;
56
use std::fs::File;
67
use std::io::{BufReader, BufWriter};
78
use std::path::PathBuf;
8-
use analyzeme::ProfilingData;
99

1010
use prettytable::Table;
1111
use serde::Serialize;

0 commit comments

Comments
 (0)