Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: components/history/core/browser/history_backend.cc

Issue 2384503002: [Downloads] Remove unmapped histograms. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/history/core/browser/download_database.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/history/core/browser/history_backend.h" 5 #include "components/history/core/browser/history_backend.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1214 size_t num_downloads_deleted = downloads_count_before - downloads_count_after; 1214 size_t num_downloads_deleted = downloads_count_before - downloads_count_after;
1215 UMA_HISTOGRAM_COUNTS("Download.DatabaseRemoveDownloadsCount", 1215 UMA_HISTOGRAM_COUNTS("Download.DatabaseRemoveDownloadsCount",
1216 num_downloads_deleted); 1216 num_downloads_deleted);
1217 base::TimeDelta micros = (1000 * (finished_removing - started_removing)); 1217 base::TimeDelta micros = (1000 * (finished_removing - started_removing));
1218 UMA_HISTOGRAM_TIMES("Download.DatabaseRemoveDownloadsTime", micros); 1218 UMA_HISTOGRAM_TIMES("Download.DatabaseRemoveDownloadsTime", micros);
1219 if (num_downloads_deleted > 0) { 1219 if (num_downloads_deleted > 0) {
1220 UMA_HISTOGRAM_TIMES("Download.DatabaseRemoveDownloadsTimePerRecord", 1220 UMA_HISTOGRAM_TIMES("Download.DatabaseRemoveDownloadsTimePerRecord",
1221 (1000 * micros) / num_downloads_deleted); 1221 (1000 * micros) / num_downloads_deleted);
1222 } 1222 }
1223 DCHECK_GE(ids.size(), num_downloads_deleted); 1223 DCHECK_GE(ids.size(), num_downloads_deleted);
1224 if (ids.size() < num_downloads_deleted)
1225 return;
1226 UMA_HISTOGRAM_COUNTS("Download.DatabaseRemoveDownloadsCountNotRemoved",
1227 ids.size() - num_downloads_deleted);
1228 } 1224 }
1229 1225
1230 void HistoryBackend::QueryHistory(const base::string16& text_query, 1226 void HistoryBackend::QueryHistory(const base::string16& text_query,
1231 const QueryOptions& options, 1227 const QueryOptions& options,
1232 QueryResults* query_results) { 1228 QueryResults* query_results) {
1233 DCHECK(query_results); 1229 DCHECK(query_results);
1234 base::TimeTicks beginning_time = base::TimeTicks::Now(); 1230 base::TimeTicks beginning_time = base::TimeTicks::Now();
1235 if (db_) { 1231 if (db_) {
1236 if (text_query.empty()) { 1232 if (text_query.empty()) {
1237 // Basic history query for the main database. 1233 // Basic history query for the main database.
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after
2646 // transaction is currently open. 2642 // transaction is currently open.
2647 db_->CommitTransaction(); 2643 db_->CommitTransaction();
2648 db_->Vacuum(); 2644 db_->Vacuum();
2649 db_->BeginTransaction(); 2645 db_->BeginTransaction();
2650 db_->GetStartDate(&first_recorded_time_); 2646 db_->GetStartDate(&first_recorded_time_);
2651 2647
2652 return true; 2648 return true;
2653 } 2649 }
2654 2650
2655 } // namespace history 2651 } // namespace history
OLDNEW
« no previous file with comments | « components/history/core/browser/download_database.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698