diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-25 09:36:19 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-25 09:36:19 +0100 |
commit | 48f9a05692e509c3bfd7df5b1088fe2863617714 (patch) | |
tree | 80f2d6a55aca6d66ff5b36c9166fd49fb76ef97b /crates/ra_prof/src/memory_usage.rs | |
parent | 0a4e90c0f855df29eb60445bf68ab959c59914ed (diff) | |
parent | 451edcc09866d43def7db88d5d9c139a96ead58e (diff) |
Merge #5531
5531: Add rustc-perf to metrics r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_prof/src/memory_usage.rs')
-rw-r--r-- | crates/ra_prof/src/memory_usage.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/ra_prof/src/memory_usage.rs b/crates/ra_prof/src/memory_usage.rs index ee79ec3ee..745345fac 100644 --- a/crates/ra_prof/src/memory_usage.rs +++ b/crates/ra_prof/src/memory_usage.rs | |||
@@ -31,6 +31,12 @@ impl fmt::Display for MemoryUsage { | |||
31 | #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] | 31 | #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] |
32 | pub struct Bytes(usize); | 32 | pub struct Bytes(usize); |
33 | 33 | ||
34 | impl Bytes { | ||
35 | pub fn megabytes(self) -> usize { | ||
36 | self.0 / 1024 / 1024 | ||
37 | } | ||
38 | } | ||
39 | |||
34 | impl fmt::Display for Bytes { | 40 | impl fmt::Display for Bytes { |
35 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | 41 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
36 | let bytes = self.0; | 42 | let bytes = self.0; |