INTEGRITY Dokumentace

Datasety (tabulky)

Cloudflare Analytics nabízí řadu datasetů, obecných i specifických pro jednotlivé produkty. Názvy datasetů se řídí jednotným schématem, které jasně určuje typ vracených dat:

Další informace o datových sadách, jejich dostupnosti, stavu beta a ukončování podpory najdete v dokumentaci GraphQL discovery funkce.

Práce s datovými sadami

Agregovaná pole

Tento příklad znázorňuje strukturu pro Groups:

type WhateverGroup {
    count # No subfields, it is just the group size. Not available for roll-up tables.
    sum {
        # fields that support summing (numbers, maps of numbers)
    }
    avg {
        # fields that support averaging (numbers)
    }
    uniq {
        # fields that support uniqueing (numbers, strings, enums, IPs, dates, etc.)
    }
}

Unikátní hodnoty nejsou dostupné jako dimenze, ale lze je dotazovat, jak ukazuje tento příklad:

{
  # Get number of bytes and unique IPs in each minute.
  httpRequests1mGroups {
    sum {
      bytes
    }
    uniq {
      uniques # unique IPs
    }
    dimensions {
      datetimeMinute
    }
  }

  # Count the number of events in each hour.
  firewallEventsAdaptiveGroups {
    count
    dimensions {
      datetimeHour
    }
  }
}

Definice typů schématu

Každá zpřístupněná tabulka má definici typu GraphQL. Definice typů se řídí těmito pravidly:

Zde je příklad definice typu pro ContentTypeMapElem:

type ContentTypeMapElem {
    edgeResponseContentType: UInt32!
    requests: UInt64!
    bytes: UInt64!
}

# An array of httpRequestsGroup is the result of httpRequests1hGroups or
# httpRequests1mGroups query.
type httpRequestsGroup {
    date: Date!
    timeslot: DateTime!
    requests: UInt64!
    contentTypeMap: [ContentTypeMapElem!]!
    # ... other fields
}

enum TrustedClientCategory {
    UNKNOWN
    REAL_BROWSER
    HONEST_BOT
}

# An array of Request is the result of httpRequests query.
type Request {
    trustedClientCategory: TrustedClientCategory!
    # ... other fields
}