 Chromium Code Reviews
 Chromium Code Reviews Issue 917943002:
  DM: JSON output adds process_max_resident_set_size_MB  (Closed) 
  Base URL: https://skia.googlesource.com/skia.git@master
    
  
    Issue 917943002:
  DM: JSON output adds process_max_resident_set_size_MB  (Closed) 
  Base URL: https://skia.googlesource.com/skia.git@master| OLD | NEW | 
|---|---|
| 1 /* | 1 /* | 
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. | 
| 3 * | 3 * | 
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be | 
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. | 
| 6 */ | 6 */ | 
| 7 | 7 | 
| 8 #include "DMJsonWriter.h" | 8 #include "DMJsonWriter.h" | 
| 9 | 9 | 
| 10 #include "ProcStats.h" | |
| 10 #include "SkCommonFlags.h" | 11 #include "SkCommonFlags.h" | 
| 11 #include "SkData.h" | 12 #include "SkData.h" | 
| 12 #include "SkJSONCPP.h" | 13 #include "SkJSONCPP.h" | 
| 13 #include "SkOSFile.h" | 14 #include "SkOSFile.h" | 
| 14 #include "SkStream.h" | 15 #include "SkStream.h" | 
| 15 #include "SkTArray.h" | 16 #include "SkTArray.h" | 
| 16 #include "SkThread.h" | 17 #include "SkThread.h" | 
| 17 | 18 | 
| 18 namespace DM { | 19 namespace DM { | 
| 19 | 20 | 
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 Json::Value result; | 68 Json::Value result; | 
| 68 result["file_name"] = gFailures[i].fileName; | 69 result["file_name"] = gFailures[i].fileName; | 
| 69 result["line_no"] = gFailures[i].lineNo; | 70 result["line_no"] = gFailures[i].lineNo; | 
| 70 result["condition"] = gFailures[i].condition; | 71 result["condition"] = gFailures[i].condition; | 
| 71 result["message"] = gFailures[i].message.c_str(); | 72 result["message"] = gFailures[i].message.c_str(); | 
| 72 | 73 | 
| 73 root["test_results"]["failures"].append(result); | 74 root["test_results"]["failures"].append(result); | 
| 74 } | 75 } | 
| 75 } | 76 } | 
| 76 | 77 | 
| 78 int maxResidentSetSizeMB = sk_tools::getMaxResidentSetSizeMB(); | |
| 79 if (maxResidentSetSizeMB != -1) { | |
| 80 root["process_max_resident_set_size_MB"] = | |
| 
jcgregorio
2015/02/12 13:15:00
Can you think of a slightly shorter name?
Also, d
 
hal.canary
2015/04/01 20:12:26
Done
 | |
| 81 sk_tools::getMaxResidentSetSizeMB(); | |
| 82 } | |
| 83 | |
| 77 SkString path = SkOSPath::Join(FLAGS_writePath[0], "dm.json"); | 84 SkString path = SkOSPath::Join(FLAGS_writePath[0], "dm.json"); | 
| 78 sk_mkdir(FLAGS_writePath[0]); | 85 sk_mkdir(FLAGS_writePath[0]); | 
| 79 SkFILEWStream stream(path.c_str()); | 86 SkFILEWStream stream(path.c_str()); | 
| 80 stream.writeText(Json::StyledWriter().write(root).c_str()); | 87 stream.writeText(Json::StyledWriter().write(root).c_str()); | 
| 81 stream.flush(); | 88 stream.flush(); | 
| 82 } | 89 } | 
| 83 | 90 | 
| 84 bool JsonWriter::ReadJson(const char* path, void(*callback)(BitmapResult)) { | 91 bool JsonWriter::ReadJson(const char* path, void(*callback)(BitmapResult)) { | 
| 85 SkAutoTUnref<SkData> json(SkData::NewFromFileName(path)); | 92 SkAutoTUnref<SkData> json(SkData::NewFromFileName(path)); | 
| 86 if (!json) { | 93 if (!json) { | 
| (...skipping 15 matching lines...) Expand all Loading... | |
| 102 br.config = r["key"]["config"].asCString(); | 109 br.config = r["key"]["config"].asCString(); | 
| 103 br.sourceType = r["key"]["source_type"].asCString(); | 110 br.sourceType = r["key"]["source_type"].asCString(); | 
| 104 br.ext = r["ext"].asCString(); | 111 br.ext = r["ext"].asCString(); | 
| 105 br.md5 = r["md5"].asCString(); | 112 br.md5 = r["md5"].asCString(); | 
| 106 callback(br); | 113 callback(br); | 
| 107 } | 114 } | 
| 108 return true; | 115 return true; | 
| 109 } | 116 } | 
| 110 | 117 | 
| 111 } // namespace DM | 118 } // namespace DM | 
| OLD | NEW |