Changeset 146628 in webkit
- Timestamp:
- Mar 22, 2013, 10:34:20 AM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/Platform/ChangeLog
r146582 r146628 1 2013-03-22 David Grogan <dgrogan@chromium.org> 2 3 IndexedDB: Histogram available disk space on attempt to open database 4 https://bugs.webkit.org/show_bug.cgi?id=112862 5 6 Reviewed by Tony Chang. 7 8 * chromium/public/Platform.h: 9 (WebKit::Platform::availableDiskSpaceInBytes): 10 (Platform): 11 1 12 2013-03-22 Tommy Widenflycht <tommyw@google.com> 2 13 -
trunk/Source/Platform/chromium/public/Platform.h
r146561 r146628 359 359 // Callable from a background WebKit thread. 360 360 virtual void callOnMainThread(void (*func)(void*), void* context) { } 361 362 // Checks the partition/volume where fileName resides. 363 virtual long long availableDiskSpaceInBytes(const WebString& fileName) { return 0; } 361 364 362 365 -
trunk/Source/WebCore/ChangeLog
r146626 r146628 1 2013-03-22 David Grogan <dgrogan@chromium.org> 2 3 IndexedDB: Histogram available disk space on attempt to open database 4 https://bugs.webkit.org/show_bug.cgi?id=112862 5 6 Reviewed by Tony Chang. 7 8 ChromeOS suspects they might be hitting disk corruption when the disks 9 are nearly full. This patch logs the available space to either the 10 "success" or the "fail" histogram as appropriate so that the 11 distributions can be compared. 12 13 No new tests - I don't know of a good way to test histograms. Local 14 printf testing didn't turn up any bugs. 15 16 * platform/leveldb/LevelDBDatabase.cpp: 17 (WebCore::HistogramFreeSpace): 18 (WebCore): 19 (WebCore::LevelDBDatabase::open): 20 1 21 2013-03-22 Nate Chapin <japhet@chromium.org> 2 22 -
trunk/Source/WebCore/platform/leveldb/LevelDBDatabase.cpp
r146561 r146628 47 47 #if PLATFORM(CHROMIUM) 48 48 #include <env_idb.h> 49 #include <public/Platform.h> 49 50 #endif 50 51 … … 141 142 const leveldb::Status s = leveldb::DestroyDB(fileName.utf8().data(), options); 142 143 return s.ok(); 144 } 145 146 static void histogramFreeSpace(const char* type, String fileName) 147 { 148 #if PLATFORM(CHROMIUM) 149 String name = "WebCore.IndexedDB.LevelDB.Open" + String(type) + "FreeDiskSpace"; 150 long long freeDiskSpaceInKBytes = WebKit::Platform::current()->availableDiskSpaceInBytes(fileName) / 1024; 151 if (freeDiskSpaceInKBytes < 0) { 152 HistogramSupport::histogramEnumeration("WebCore.IndexedDB.LevelDB.FreeDiskSpaceFailure", 1/*sample*/, 2/*boundary*/); 153 return; 154 } 155 int clampedDiskSpaceKBytes = freeDiskSpaceInKBytes > INT_MAX ? INT_MAX : freeDiskSpaceInKBytes; 156 const uint64_t histogramMax = static_cast<uint64_t>(1e9); 157 COMPILE_ASSERT(histogramMax <= INT_MAX, histogramMaxTooBig); 158 HistogramSupport::histogramCustomCounts(name.utf8().data(), clampedDiskSpaceKBytes, 1, histogramMax, 11/*buckets*/); 159 #endif 143 160 } 144 161 … … 167 184 HistogramSupport::histogramEnumeration("WebCore.IndexedDB.LevelDBOpenErrors", levelDBError, LevelDBMaxError); 168 185 186 histogramFreeSpace("Failure", fileName); 187 169 188 LOG_ERROR("Failed to open LevelDB database from %s: %s", fileName.ascii().data(), s.ToString().c_str()); 170 189 return nullptr; 171 190 } 191 192 histogramFreeSpace("Success", fileName); 172 193 173 194 OwnPtr<LevelDBDatabase> result = adoptPtr(new LevelDBDatabase);
Note:
See TracChangeset
for help on using the changeset viewer.