File tree Expand file tree Collapse file tree 1 file changed +0
-24
lines changed
firebase-perf/src/main/java/com/google/firebase/perf/session/gauges Expand file tree Collapse file tree 1 file changed +0
-24
lines changed Original file line number Diff line number Diff line change 2222import com .google .firebase .perf .util .StorageUnit ;
2323import com .google .firebase .perf .util .Utils ;
2424import com .google .firebase .perf .v1 .GaugeMetadata ;
25- import java .io .BufferedReader ;
26- import java .io .FileReader ;
27- import java .io .IOException ;
28- import java .util .regex .Matcher ;
29- import java .util .regex .Pattern ;
3025
3126/**
3227 * The {@code GaugeMetadataManager} class is responsible for collecting {@link GaugeMetadata}
@@ -73,23 +68,4 @@ public int getMaxEncouragedAppJavaHeapMemoryKb() {
7368 public int getDeviceRamSizeKb () {
7469 return Utils .saturatedIntCast (StorageUnit .BYTES .toKilobytes (memoryInfo .totalMem ));
7570 }
76-
77- /** Returns the total ram size of the device (in kilobytes) by reading the "proc/meminfo" file. */
78- @ VisibleForTesting
79- int readTotalRAM (String procFileName ) {
80- try (BufferedReader br = new BufferedReader (new FileReader (procFileName ))) {
81- for (String s = br .readLine (); s != null ; s = br .readLine ()) {
82- if (s .startsWith ("MemTotal" )) {
83- Matcher m = Pattern .compile ("\\ d+" ).matcher (s );
84- return m .find () ? Integer .parseInt (m .group ()) : 0 ;
85- }
86- }
87- } catch (IOException ioe ) {
88- logger .warn ("Unable to read '" + procFileName + "' file: " + ioe .getMessage ());
89- } catch (NumberFormatException nfe ) {
90- logger .warn ("Unable to parse '" + procFileName + "' file: " + nfe .getMessage ());
91- }
92-
93- return 0 ;
94- }
9571}
You can’t perform that action at this time.
0 commit comments