Home / Transparency

Transparency

This page explains the view count published on this site. Views come from the Cloudflare Analytics Engine.

A view is every person who visited the website. That count is read from Workers Analytics Engine.

How a view is counted

  1. 1 A person opens the site Every person who visits the website counts as a view.
  2. 2 The site tells Cloudflare The visit is sent to Cloudflare to be recorded.
  3. 3 Cloudflare stores the visit Workers Analytics Engine keeps it as one data point.
  4. 4 The total comes back The site reads that total and shows it as Views.
  1. 1

    A person opens the site

    Every person who visits the website counts as a view.

  2. 2

    The site tells Cloudflare

    The visit is sent to Cloudflare to be recorded.

  3. 3

    Cloudflare stores the visit

    Workers Analytics Engine keeps it as one data point.

  4. 4

    The total comes back

    The site reads that total and shows it as Views.

Views are written in Cloudflare and read back onto the page.

Workers Analytics Engine is Cloudflare's store for counts that can grow without a fixed list of categories. Cloudflare describes it as unlimited-cardinality analytics at scale. A Worker writes a data point through a built-in API. The same account later reads those points with SQL, over an HTTP SQL API. That SQL dialect is separate from Cloudflare's other Analytics SQL API.

A dataset is the unit of storage. Cloudflare compares a dataset to a table in SQL: each row and each column should keep one consistent meaning. The dataset is named in the Worker configuration and bound to the Worker. The table appears when the Worker starts writing. Columns are not declared in a separate step.

A data point is one event, one row. Cloudflare adds a timestamp when the Worker logs the event. Everything else is supplied by the Worker, and it must be supplied in the same order every time. Cloudflare calls each of those ordered slots a field.

A field is one position in that order. The first string is always the first string field. The second number is always the second number field. The database does not store a name beside the value. It stores the position. Change the order, and the meaning of the field changes with it. In a query, positions become columns. String fields are blob1 through blob20. Number fields are double1 through double20. The sampling key is index1. Every row also has timestamp, dataset, and _sample_interval. A query may rename a field for that question, for example blob1 AS city. The stored field is still blob1.

What a field is

  1. Words, listed in order Labels you may want to group by later, such as a place.
    blob1, then blob2, up to blob20 The name of this field in Cloudflare.
  2. Numbers, listed in order Measurements you may want to add up or average.
    double1, then double2, up to double20 The name of this field in Cloudflare.
  3. One index The key Cloudflare uses if a busy stream of events has to be sampled.
    index1 The name of this field in Cloudflare.
  4. The time, added by Cloudflare The moment the event was written.
    timestamp The name of this field in Cloudflare.
  5. The sample size, added by Cloudflare How many original events this stored row stands for.
    _sample_interval The name of this field in Cloudflare.
  1. Words, listed in order

    Labels you may want to group by later, such as a place.

    Stored as blob1, then blob2, up to blob20

  2. Numbers, listed in order

    Measurements you may want to add up or average.

    Stored as double1, then double2, up to double20

  3. One index

    The key Cloudflare uses if a busy stream of events has to be sampled.

    Stored as index1

  4. The time, added by Cloudflare

    The moment the event was written.

    Stored as timestamp

  5. The sample size, added by Cloudflare

    How many original events this stored row stands for.

    Stored as _sample_interval

Each field keeps its place. A query can rename blob1 for that question. The stored field is still blob1.

There are three kinds of field. Blobs are strings. Cloudflare calls them the dimensions used for grouping and filtering, what other systems call labels. A point may carry twenty blobs, and together they must stay within 16 kilobytes. Doubles are numbers, the measurements to add or average. A point may carry twenty doubles. The index is one string of at most 96 bytes. The write accepts a list, but Cloudflare stores the point only when that list holds a single index. A second index means the point is not recorded.

At very high volume, Analytics Engine samples its data so queries stay fast. Sampling can happen on write and on read, and it follows the index. An index with a large number of events may be sampled. A quieter index can remain unsampled. Each stored row includes _sample_interval, the number of original events that row represents. A count is the sum of _sample_interval. A sum of a measurement multiplies that measurement by _sample_interval first. An average divides the weighted sum by the sum of the intervals.

One Worker invocation can write at most 250 data points. Data is stored for three months.