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

Unified Diff: components/certificate_transparency/single_tree_tracker.cc

Issue 2153123002: Certificate Transparency: Collect metrics on age of SCT vs STH (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename histogram Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: components/certificate_transparency/single_tree_tracker.cc
diff --git a/components/certificate_transparency/single_tree_tracker.cc b/components/certificate_transparency/single_tree_tracker.cc
index 7946208ca753303a7589260e7a60fd34a58bb5e0..2d379fa066d849b2511de4aa5499e24d6c7a7355 100644
--- a/components/certificate_transparency/single_tree_tracker.cc
+++ b/components/certificate_transparency/single_tree_tracker.cc
@@ -6,12 +6,18 @@
#include <utility>
+#include "base/metrics/histogram_macros.h"
#include "net/cert/ct_log_verifier.h"
#include "net/cert/signed_certificate_timestamp.h"
#include "net/cert/x509_certificate.h"
using net::ct::SignedTreeHead;
+namespace {
+const char kCanCheckForInclusionHistogramName[] =
+ "Net.CertificateTransparency.CanInclusionCheckSCT";
Alexei Svitkine (slow) 2016/07/18 15:03:57 If you're only going to use it from the same file
Eran Messeri 2016/07/20 11:02:17 Done.
+}
+
namespace certificate_transparency {
SingleTreeTracker::SingleTreeTracker(
@@ -34,15 +40,18 @@ void SingleTreeTracker::OnSCTVerified(
if (verified_sth_.timestamp.is_null() ||
(verified_sth_.timestamp <
(sct->timestamp + base::TimeDelta::FromHours(24)))) {
- // TODO(eranm): UMA - how often SCTs have to wait for a newer STH for
- // inclusion check.
entries_status_.insert(
std::make_pair(sct->timestamp, SCT_PENDING_NEWER_STH));
+
+ // Do not log histogram if there's no STH for this log yet, as it does
+ // not provide any meaningful data on how fresh SCTs usually are.
+ if (!verified_sth_.timestamp.is_null())
+ UMA_HISTOGRAM_BOOLEAN(kCanCheckForInclusionHistogramName, false);
return;
}
+ UMA_HISTOGRAM_BOOLEAN(kCanCheckForInclusionHistogramName, true);
Alexei Svitkine (slow) 2016/07/18 15:03:57 Each UMA macro expansion results in a bunch of cod
Eran Messeri 2016/07/20 11:02:17 Done.
// TODO(eranm): Check inclusion here.
- // TODO(eranm): UMA - how often inclusion can be checked immediately.
entries_status_.insert(
std::make_pair(sct->timestamp, SCT_PENDING_INCLUSION_CHECK));
}

Powered by Google App Engine
This is Rietveld 408576698