Interface AnalyticsEngine

All Superinterfaces:
org.teavm.jso.JSObject

public interface AnalyticsEngine extends org.teavm.jso.JSObject
An Analytics Engine dataset. Declared with analytics(), named ANALYTICS by default.

The one binding here that does not block. Writes are fire and forget: nothing is returned, no promise settles, and a failure is not reported. Reading the data back is a SQL API call from outside the Worker rather than anything on this binding.

A data point carries at most 20 doubles, 20 blobs and one index, where the index is what queries group by.

 env.analytics().write(DataPoint.of()
 	.index(request.getHeaders().get("cf-ipcountry"))
 	.blob(request.getUrl())
 	.number(response.getStatus()));
Since:
1.0.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    A data point under construction.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Records one data point.
    void
    Records one data point.

    Methods inherited from interface org.teavm.jso.JSObject

    cast
  • Method Details

    • writeDataPoint

      void writeDataPoint(TSObject point)
      Records one data point.
      Parameters:
      point - the point
    • write

      default void write(AnalyticsEngine.DataPoint point)
      Records one data point.
      Parameters:
      point - the point