blob: 6fe725645a0b791bbcde1abaa3d7eebf083f5c97 [file] [log] [blame]
// Copyright 2022 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
{
include: [
"//src/connectivity/network/lib/net_interfaces/client.shard.cml",
"//src/lib/fuchsia-hyper/hyper.shard.cml",
"inspect/client.shard.cml",
"syslog/client.shard.cml",
],
program: {
runner: "elf",
binary: "bin/httpsdate_time_source",
},
capabilities: [
{
protocol: [
"fuchsia.time.external.PullSource",
"fuchsia.time.external.PushSource",
],
},
],
use: [
{
protocol: [ "fuchsia.metrics.MetricEventLoggerFactory" ],
from: "parent",
},
{
directory: "root-ssl-certificates",
rights: [ "r*" ],
path: "/config/ssl",
},
],
expose: [
{
protocol: [
"fuchsia.time.external.PullSource",
"fuchsia.time.external.PushSource",
],
from: "self",
},
],
config: {
// The endpoint URL for querying time information. The HTTPS time source
// uses the time reported in HTTPS responses to estimate current time.
// None of the other approaches such as NTP are acceptable for Fuchsia
// products in general.
//
// URI used to obtain time samples.
// time_source_endpoint_url: "https://clients3.google.com/generate_204",
time_source_endpoint_url: {
type: "string",
// A nice, round, number.
max_size: 1024,
},
// HTTPS request is considered failed after the timeout.
//
// Currently based on a best guess.
// https_timeout_sec: 10,
https_timeout_sec: { type: "uint8" },
// The ratio between a standard deviation and a final bound size, expressed as a percentage.
standard_deviation_bound_percentage: { type: "uint8" },
// How many times longer than a subsequent poll the first poll will take. This encapsulates
// the additional time required during the first HTTPS request to setup a TLS connection and
// is used to make a best guess for how long the second call will take.
//
// This value is based on a best guess how many times longer than a subsequent poll the first
// poll will take.
// first_rtt_time_factor: 5,
first_rtt_time_factor: { type: "uint16" },
// If enabled, `fuchsia.time.external.PullSource` is provided instead of
// `fuchsia.time.external.PushSource`.
//
// By default, `fuchsia.time.external.PushSource` is provided.
// use_pull_api: false,
use_pull_api: { type: "bool" },
// Max number fetch attempts for `fuchsia.time.external.Urgency.Low`.
//
// Initial value.
// max_attempts_urgency_low: 4,
max_attempts_urgency_low: { type: "uint32" },
// Number of polls per sample for `fuchsia.time.external.Urgency.Low`.
//
// As per estimations, increasing further wouldn't bring sizeable benefits.
// num_polls_urgency_low: 7,
num_polls_urgency_low: { type: "uint32" },
// Max number fetch attempts for `fuchsia.time.external.Urgency.Medium`.
//
// Initial value.
// max_attempts_urgency_medium: 3,
max_attempts_urgency_medium: { type: "uint32" },
// Number of polls per sample for `fuchsia.time.external.Urgency.Medium`.
//
// Fastest sample that gives a bound size within desired target range based on a typical
// oscillator tolerance.
// num_polls_urgency_medium: 5,
num_polls_urgency_medium: { type: "uint32" },
// Max number fetch attempts for `fuchsia.time.external.Urgency.High`.
//
// Initial value.
// max_attempts_urgency_high: 3,
max_attempts_urgency_high: { type: "uint32" },
// Number of polls per sample for `fuchsia.time.external.Urgency.High`.
//
// Fastest possible sample that gives an acceptable worst case slew duration.
// num_polls_urgency_high: 3,
num_polls_urgency_high: { type: "uint32" },
},
}