Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpdateAnalyticsBQSchema ¶
UpdateAnalyticsBQSchema updates the bigquery schema if fields are added.
Types ¶
type WebVital ¶
type WebVital struct { // The name of the metric (in acronym form). Name string `json:"name"` // The current value of the metric. Value float64 `json:"value"` // The delta between the current value and the last-reported value. // On the first report, `delta` and `value` will always be the same. Delta float64 `json:"delta"` // A unique ID representing this particular metric that's specific to the // current page. This ID can be used by an analytics tool to dedupe // multiple values sent for the same metric, or to group multiple deltas // together and calculate a total. ID string `json:"id"` // Type of metric (web-vital or custom). Label bigquery.NullString `json:"label"` // When we recorded this metric. Time bigquery.NullDateTime // What service this is for. Service bigquery.NullString }
WebVital is a a version of https://web.dev/vitals/.
See also https://nextjs.org/docs/advanced-features/measuring-performance#build-your-own.
func ParseAnalytics ¶
ParseAnalytics parses a webvitals request body.
type WebVitalSummary ¶
type WebVitalSummary struct { // The name of the metric (in acronym form). Name string `json:"name"` // The current value of the metric. Value float64 `json:"value"` Service string `json:"service"` Day bigquery.NullDate `json:"date"` }
func GetAnalytics ¶
func GetAnalytics(ctx context.Context, site, project, dataset, table string) ([]*WebVitalSummary, error)
Click to show internal directories.
Click to hide internal directories.