Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Metrics Window Summary

observability.summarize_metrics_window

ProductionBounded custom (Class B)Deterministicstrictfastv1.0.0
No network

Overview

You send samples and a window and we return the count, the extremes, the mean, the sum and six percentiles, every figure rounded once at your declared scale. The window is half-open, so a sample exactly on the start counts and one exactly on the end does not, which is what makes a row of adjacent windows add up to their union. Samples outside the window are excluded and counted rather than refused, so an overshooting slice still gets an answer that says so. The interpolation method is echoed, so a stored summary is reproducible in a spreadsheet without reading anything else.

Percentiles are where two teams quietly disagree: one interpolates, one picks the nearest rank, one rounds before comparing, and the numbers stop matching. This publishes the method and echoes it with every answer.

Reliability

Fully deterministic and clock-free, and the summation order is fixed ascending so a shuffled request and a sorted one give byte-identical answers. The empty set returns nulls rather than zeros, and a single sample makes every percentile equal to it. Failures, none worth retrying unchanged: OBS_METRICS_SAMPLES_INVALID means samples was absent, was not an array, or an entry was not an object carrying t and v. OBS_METRICS_SAMPLE_LIMIT_EXCEEDED means more than 50000 samples arrived, so split the window and summarise each part. OBS_METRICS_SAMPLE_NON_FINITE means a value was a not-a-number or an infinity, and the answer names its index; JSON cannot carry either, so publishing one is not an option. OBS_METRICS_TIMESTAMP_INVALID means a timestamp was absent, unparseable or carried no offset, and the answer names its position. OBS_METRICS_OFFSET_MIXED means the set mixed offsets under REQUIRE_UNIFORM or carried a non-UTC one under REQUIRE_UTC, with both positions named. OBS_METRICS_WINDOW_INVALID means end was not after start or the span fell outside 1 millisecond to 366 days. OBS_METRICS_SCALE_INVALID means scale fell outside 0 to 12. OBS_METRICS_OPTION_UNSUPPORTED means a property or an offset policy is not one we accept.

Context footprint

The answer is one fixed-shape summary whatever the sample count, so 50000 samples cost the same context as five. A successful call costs 2 execution credits.

When to use it

When you hold timestamped numbers and want defensible extremes, a mean and percentiles over a stated window.

When you need grouping, resampling, gap filling or a verdict against an objective.

Scope

Note
Summarise one series of timestamped samples over one half-open window, with a closed percentile set and one published rounding.

Non-goals

  • Does not group rows, which data.aggregate answers
  • Does not resample, convert to a rate or fill a gap
  • Does not interpolate between samples — a missing sample stays missing
  • Does not fetch or store a metric, and reads no clock
  • Does not accept a caller-chosen percentile; the six are fixed

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

analysis

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call2 credits

File handling

Accepts file_refProduces file_refMax input1 MB

How we handle your data

Sensitive output possible
What this means

This skill may receive sensitive content and may return submitted, transformed, extracted, or reformatted content.

Squillify guarantees
  • Runs inside Squillify
  • This skill runs inside Squillify.
  • Payloads are not sent to an external service by this skill.
  • Squillify does not permanently store submitted payloads.
  • Telemetry records metadata only, not submitted content.
  • Submitted payloads are not used for training.
  • Submitted payloads are not reviewed by humans.
  • This skill does not target sensitive data.
  • The response may contain submitted or transformed content.
Your responsibility

Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
samplesarrayYesSamples, 0 to 50000 closed {t, v} objects; an empty array returns the empty summary rather than a failure.
windowobjectYesClosed half-open window [start, end) as ISO-8601 instants with explicit offsets.
seriesstringNoLabel of 1 to 128 code points echoed back untouched; omit it and the answer carries JSON null.
scaleintegerNoDecimal places from 0 through 12; omit it for 6.
offsetPolicystringNoOffset mixing rule; omit it for REQUIRE_UNIFORM.

Output schema

FieldTypeRequiredDescription
seriesstringYesThe label you sent, echoed verbatim so a stored summary still names which series it measured; JSON null when you sent none.
windowobjectYesParsed window as we applied it, with the inclusivity literal and durationSeconds added so two summaries can be compared knowing they cover the same interval.
countintegerYesIn-window samples with a value.
nullCountintegerYesIn-window samples whose value was JSON null.
emptybooleanYesTrue when no in-window sample carried a value.
minnumberYesSmallest in-window value at your scale, or JSON null on an empty set.
maxnumberYesLargest in-window value at your scale, or JSON null on an empty set.
meannumberYesArithmetic mean at your scale, or JSON null on an empty set.
sumnumberYesTotal at your scale, or JSON null on an empty set.
percentilesobjectYesClosed percentile set p50, p75, p90, p95, p99 and p99_9, each at your scale or JSON null on an empty set.
lowResolutionPercentilesarrayYesPercentile keys determined by fewer than two distinct order statistics, 0 to 6 strings.
interpolationstringYesAlways LINEAR_ORDER_STATISTIC_TYPE_7, echoed so a stored summary reproduces unaided.
outOfWindowCountintegerYesSamples excluded because their timestamp fell outside the window.
scaleintegerYesDecimal places actually applied, echoed so figures can be compared with another summary honestly.
roundingModestringYesAlways HALF_UP, the one rounding mode the platform publishes.
firstSampleAtstringYesEarliest in-window valued sample, or JSON null on an empty set.
lastSampleAtstringYesLatest in-window valued sample, or JSON null on an empty set.
sampleCoverageSecondsintegerYesWhole seconds between the first and last valued sample, or JSON null on an empty set.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"observability.summarize_metrics_window","input":{"samples":[{"t":"2026-07-29T10:00:00Z","v":10}],"window":{"start":"2026-07-29T10:00:00Z","end":"2026-07-29T10:05:00Z"}}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("observability.summarize_metrics_window", {"series":"http.server.duration","window":{"start":"2026-07-29T10:00:00Z","end":"2026-07-29T10:05:00Z"},"samples":[{"v":10,"t":"2026-07-29T10:00:00Z"},{"v":20,"t":"2026-07-29T10:01:00Z"},{"v":30,"t":"2026-07-29T10:02:00Z"},{"v":40,"t":"2026-07-29T10:05:00Z"}]});

Errors

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.
OBS_METRICS_SAMPLES_INVALID400NoThe request payload failed this skill's input validation.
OBS_METRICS_SAMPLE_LIMIT_EXCEEDED429NoA size, quota, rate, or time limit was exceeded.
OBS_METRICS_SAMPLE_NON_FINITE400NoThe request payload failed this skill's input validation.
OBS_METRICS_TIMESTAMP_INVALID400NoThe request payload failed this skill's input validation.
OBS_METRICS_OFFSET_MIXED400NoThe request payload failed this skill's input validation.
OBS_METRICS_WINDOW_INVALID400NoThe request payload failed this skill's input validation.
OBS_METRICS_SCALE_INVALID400NoThe request payload failed this skill's input validation.
OBS_METRICS_OPTION_UNSUPPORTED400NoThe skill does not support the requested variant.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not group rows, which data.aggregate answers
  • Does not resample, convert to a rate or fill a gap
  • Does not interpolate between samples — a missing sample stays missing
  • Does not fetch or store a metric, and reads no clock
  • Does not accept a caller-chosen percentile; the six are fixed
  • Grouping rows by a key and reducing each group, which data.aggregate answers
  • Deciding whether an objective was met, which observability.calculate_sli answers

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "observability.summarize_metrics_window",
  "input": {
    "series": "http.server.duration",
    "window": {
      "start": "2026-07-29T10:00:00Z",
      "end": "2026-07-29T10:05:00Z"
    },
    "samples": [
      {
        "v": 10,
        "t": "2026-07-29T10:00:00Z"
      },
      {
        "v": 20,
        "t": "2026-07-29T10:01:00Z"
      },
      {
        "v": 30,
        "t": "2026-07-29T10:02:00Z"
      },
      {
        "v": 40,
        "t": "2026-07-29T10:05:00Z"
      }
    ]
  }
}

Examples

Four samples, one of them out of the window

Inputjson
{
  "series": "http.server.duration",
  "window": {
    "start": "2026-07-29T10:00:00Z",
    "end": "2026-07-29T10:05:00Z"
  },
  "samples": [
    {
      "v": 10,
      "t": "2026-07-29T10:00:00Z"
    },
    {
      "v": 20,
      "t": "2026-07-29T10:01:00Z"
    },
    {
      "v": 30,
      "t": "2026-07-29T10:02:00Z"
    },
    {
      "v": 40,
      "t": "2026-07-29T10:05:00Z"
    }
  ]
}
Expected outputjson
{
  "lowResolutionPercentiles": [
    "p75",
    "p90",
    "p95",
    "p99",
    "p99_9"
  ],
  "count": 3,
  "max": 30,
  "firstSampleAt": "2026-07-29T10:00:00Z",
  "sum": 60,
  "outOfWindowCount": 1,
  "percentiles": {
    "p50": 20,
    "p75": 25,
    "p90": 28,
    "p95": 29,
    "p99": 29.8,
    "p99_9": 29.98
  },
  "sampleCoverageSeconds": 120,
  "scale": 6,
  "series": "http.server.duration",
  "interpolation": "LINEAR_ORDER_STATISTIC_TYPE_7",
  "empty": false,
  "roundingMode": "HALF_UP",
  "lastSampleAt": "2026-07-29T10:02:00Z",
  "min": 10,
  "nullCount": 0,
  "mean": 20,
  "window": {
    "start": "2026-07-29T10:00:00Z",
    "end": "2026-07-29T10:05:00Z",
    "inclusivity": "[start,end)",
    "durationSeconds": 300
  }
}
Tip
The sample exactly on the window end is excluded by the half-open rule, and p50 of ten, twenty and thirty is twenty.

A single sample, where every percentile is that sample

Inputjson
{
  "series": "http.server.duration",
  "window": {
    "start": "2026-07-29T10:00:00Z",
    "end": "2026-07-29T10:05:00Z"
  },
  "samples": [
    {
      "v": 42,
      "t": "2026-07-29T10:00:00Z"
    }
  ]
}
Expected outputjson
{
  "lowResolutionPercentiles": [
    "p50",
    "p75",
    "p90",
    "p95",
    "p99",
    "p99_9"
  ],
  "count": 1,
  "max": 42,
  "firstSampleAt": "2026-07-29T10:00:00Z",
  "sum": 42,
  "outOfWindowCount": 0,
  "percentiles": {
    "p50": 42,
    "p75": 42,
    "p90": 42,
    "p95": 42,
    "p99": 42,
    "p99_9": 42
  },
  "sampleCoverageSeconds": 0,
  "scale": 6,
  "series": "http.server.duration",
  "interpolation": "LINEAR_ORDER_STATISTIC_TYPE_7",
  "empty": false,
  "roundingMode": "HALF_UP",
  "lastSampleAt": "2026-07-29T10:00:00Z",
  "min": 42,
  "nullCount": 0,
  "mean": 42,
  "window": {
    "start": "2026-07-29T10:00:00Z",
    "end": "2026-07-29T10:05:00Z",
    "inclusivity": "[start,end)",
    "durationSeconds": 300
  }
}
Tip
One sample makes the minimum, the maximum, the mean and every percentile the same number, and the low-resolution list warns that the tail percentiles rest on it alone.
  • Get p95 and p99 for a five-minute slice of latency samples you already hold
  • Compare two adjacent windows knowing the boundary rule cannot double-count

Avoid for

  • Grouping rows by a key and reducing each group, which data.aggregate answers
  • Deciding whether an objective was met, which observability.calculate_sli answers

Composable with

Safety & privacy

  • Runs without calling any external service.
  • Your payloads are never stored permanently.
  • Telemetry captures metadata only — never your payload contents.
  • We never train models on your payloads.
  • No human reviews your payloads.

Tags

statisticsanalysisobservabilitymetrics