| 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..a94c8ddfdcc7ba7040b7253bf7c5c64afdcf208e 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 kPendingSTHHistogramName[] =
|
| + "Net.CertificateTransparency.SCTNeedsFreshSTH";
|
| +}
|
| +
|
| 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(kPendingSTHHistogramName, true);
|
| return;
|
| }
|
|
|
| + UMA_HISTOGRAM_BOOLEAN(kPendingSTHHistogramName, false);
|
| // 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));
|
| }
|
|
|