summaryrefslogtreecommitdiffstats
path: root/o3d/statsreport
diff options
context:
space:
mode:
authorrlp@google.com <rlp@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-09 23:13:54 +0000
committerrlp@google.com <rlp@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-09 23:13:54 +0000
commita656dfedee36ea7fdff377604d665d484a549243 (patch)
tree50e79ec9fdbdf38ae535984cfab845e7271cfd4f /o3d/statsreport
parentba625918f43f292ef3fbc5563770be7bbfd1f233 (diff)
downloadchromium_src-a656dfedee36ea7fdff377604d665d484a549243.zip
chromium_src-a656dfedee36ea7fdff377604d665d484a549243.tar.gz
chromium_src-a656dfedee36ea7fdff377604d665d484a549243.tar.bz2
Updating the installer to check for OpenGL stats. Requires saving those stats and uploading with others which required a modification of the stats uploading code to actually save old stats--which it should do anyways.
Review URL: http://codereview.chromium.org/295043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31502 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/statsreport')
-rw-r--r--o3d/statsreport/uploader.h4
-rw-r--r--o3d/statsreport/uploader_aggregation-mac.mm9
-rw-r--r--o3d/statsreport/uploader_aggregation-posix.cc9
-rw-r--r--o3d/statsreport/uploader_aggregation-win32.cc9
4 files changed, 21 insertions, 10 deletions
diff --git a/o3d/statsreport/uploader.h b/o3d/statsreport/uploader.h
index f514171..39b2b7c 100644
--- a/o3d/statsreport/uploader.h
+++ b/o3d/statsreport/uploader.h
@@ -56,10 +56,12 @@ class StatsUploader {
bool AggregateMetrics();
bool AggregateAndReportMetrics(const char* extra_url_arguments,
const char* user_agent,
- bool force_report);
+ bool force_report,
+ bool save_old_metrics);
bool TestableAggregateAndReportMetrics(const char* extra_url_arguments,
const char* user_agent,
bool force_report,
+ bool save_old_metrics,
StatsUploader* stats_uploader);
bool UploadMetrics(const char* extra_url_data, const char* user_agent,
const char *content);
diff --git a/o3d/statsreport/uploader_aggregation-mac.mm b/o3d/statsreport/uploader_aggregation-mac.mm
index c742490..ef564a0 100644
--- a/o3d/statsreport/uploader_aggregation-mac.mm
+++ b/o3d/statsreport/uploader_aggregation-mac.mm
@@ -128,10 +128,12 @@ void ResetPersistentMetrics() {
// were uploaded
bool AggregateAndReportMetrics(const char* extra_url_arguments,
const char* user_agent,
- bool force_report) {
+ bool force_report,
+ bool save_old_metrics) {
StatsUploader stats_uploader;
return TestableAggregateAndReportMetrics(extra_url_arguments, user_agent,
- force_report, &stats_uploader);
+ force_report, save_old_metrics,
+ &stats_uploader);
}
static int GetLastTransmissionTime() {
@@ -171,6 +173,7 @@ static void SetLastTransmissionTime(int when) {
bool TestableAggregateAndReportMetrics(const char* extra_url_arguments,
const char* user_agent,
bool force_report,
+ bool save_old_metrics,
StatsUploader* stats_uploader) {
// Open the store
MetricsAggregatorMac aggregator(g_global_metrics);
@@ -185,7 +188,7 @@ bool TestableAggregateAndReportMetrics(const char* extra_url_arguments,
if (last_transmission_time == 0 || last_transmission_time > now) {
LOG(WARNING) << "dodgy or missing last transmission time, wiping stats";
- ResetPersistentMetrics();
+ if (!save_old_metrics) ResetPersistentMetrics();
SetLastTransmissionTime(now);
diff --git a/o3d/statsreport/uploader_aggregation-posix.cc b/o3d/statsreport/uploader_aggregation-posix.cc
index 91f807b..4163326 100644
--- a/o3d/statsreport/uploader_aggregation-posix.cc
+++ b/o3d/statsreport/uploader_aggregation-posix.cc
@@ -86,10 +86,12 @@ bool AggregateMetrics() {
// were uploaded
bool AggregateAndReportMetrics(const char* extra_url_arguments,
const char* user_agent,
- bool force_report) {
+ bool force_report,
+ bool save_old_metrics) {
StatsUploader stats_uploader;
return TestableAggregateAndReportMetrics(extra_url_arguments, user_agent,
- force_report, &stats_uploader);
+ force_report, save_old_metrics,
+ &stats_uploader);
}
// Returns:
// true if metrics were uploaded successfully, false otherwise
@@ -98,6 +100,7 @@ bool AggregateAndReportMetrics(const char* extra_url_arguments,
bool TestableAggregateAndReportMetrics(const char* extra_url_arguments,
const char* user_agent,
bool force_report,
+ bool save_old_metrics,
StatsUploader* stats_uploader) {
// Open the store
MetricsAggregatorPosix aggregator(g_global_metrics);
@@ -114,7 +117,7 @@ bool TestableAggregateAndReportMetrics(const char* extra_url_arguments,
if (!success || last_transmission_time > now) {
LOG(WARNING) << "Hinky or missing last transmission time, wiping stats";
- aggregator.ResetMetrics();
+ if (!save_old_metrics) aggregator.ResetMetrics();
success = aggregator.SetValue(kLastTransmissionTimeValueName, now);
if (!success)
diff --git a/o3d/statsreport/uploader_aggregation-win32.cc b/o3d/statsreport/uploader_aggregation-win32.cc
index d2f438e..d128c77 100644
--- a/o3d/statsreport/uploader_aggregation-win32.cc
+++ b/o3d/statsreport/uploader_aggregation-win32.cc
@@ -88,10 +88,12 @@ void ResetPersistentMetrics(CRegKey *key) {
// were uploaded
bool AggregateAndReportMetrics(const char* extra_url_arguments,
const char* user_agent,
- bool force_report) {
+ bool force_report,
+ bool save_old_metrics) {
StatsUploader stats_uploader;
return TestableAggregateAndReportMetrics(extra_url_arguments, user_agent,
- force_report, &stats_uploader);
+ force_report, save_old_metrics,
+ &stats_uploader);
}
// Returns:
// true if metrics were uploaded successfully, false otherwise
@@ -100,6 +102,7 @@ bool AggregateAndReportMetrics(const char* extra_url_arguments,
bool TestableAggregateAndReportMetrics(const char* extra_url_arguments,
const char* user_agent,
bool force_report,
+ bool save_old_metrics,
StatsUploader* stats_uploader) {
CString key_name;
key_name.Format(kStatsKeyFormatString, PRODUCT_NAME_STRING_WIDE);
@@ -127,7 +130,7 @@ bool TestableAggregateAndReportMetrics(const char* extra_url_arguments,
last_transmission_time > now) {
DLOG(WARNING) << "Hinky or missing last transmission time, wiping stats";
- ResetPersistentMetrics(&key);
+ if (!save_old_metrics) ResetPersistentMetrics(&key);
err = key.SetValue(kLastTransmissionTimeValueName, REG_DWORD,
&now, sizeof(now));