Krizaka
Documentation
Composants

Job throughput

Jobs per period stacked by status, with the total and the success rate of the finished jobs written above.

Web + MobileBêtaGraphiques

Web et mobile — le même composant pour React et React Native. Bêta : son API peut encore changer à une version mineure.

Pourquoi il est là. Orazaka's jobs per period by status (PS-C).

Quand l’utiliser

  • Orazaka's insights and the console's supervision: jobs per day by status.
  • The mobile Jobs screen: the total and the success rate first, the week's bars under them.
  • Any queue whose items end in success or failure: uploads, payouts, transcodes.

Quand ne pas l’utiliser

Installation

Installer

npm install @krizaka/charts

Importer

import { JobThroughput } from "@krizaka/charts/throughput";

Exemples

A week of jobs

Seven days of Orazaka jobs by status, the success rate above.

Jobs this week

10,519jobs over 7 days97.5% succeeded

Bar chart, 4 × 7 (Oct 5 – Oct 11). Completed: from 1,240 to 986, lowest 986 (Oct 11), highest 1,934 (Oct 9), down 20%. Failed: from 38 to 12, lowest 12 (Oct 11), highest 95 (Oct 7), down 68%. Running: from 0 to 24, lowest 0 (Oct 5), highest 24 (Oct 11). Queued: from 0 to 63, lowest 0 (Oct 5), highest 63 (Oct 11).

Jobs this week — data
CategoryCompletedFailedRunningQueued
Oct 51,2403800
Oct 61,6124100
Oct 71,5059500
Oct 81,7882700
Oct 91,9343300
Oct 101,1021900
Oct 11986122463

Live, per hour

The last hours, live, with the console's own statuses.

Requests per hour

1,362requests over 5 hours96.7% succeeded

Bar chart, 3 × 5 (9:00 AM – 1:00 PM). Done: from 212 to 190, lowest 190 (1:00 PM), highest 301 (11:00 AM), down 10%. Rejected: from 4 to 3, lowest 3 (1:00 PM), highest 22 (11:00 AM), down 25%. Waiting: from 9 to 40, lowest 9 (9:00 AM), highest 40 (1:00 PM), up 344%.

Requests per hour — data
CategoryDoneRejectedWaiting
9:00 AM21249
10:00 AM268714
11:00 AM3012231
12:00 PM244512
1:00 PM190340

Props

Jobs per period, stacked by status, with the total and the success rate.

PropTypeDéfautDescription
datarequisreadonly T[]—The rows, in the order of the x axis.
titlerequisstring—What the chart shows, in a few words: its accessible name, and its heading unless hideTitle.
brandBrandId—The brand whose palette the charts use. Without it, a chart follows a .brand-<id> ancestor, else Krizaka. Set it when the app loads a brand stylesheet on :root (@krizaka/tokens/brands/orazaka.css).
classNamestring—A class on the figure (layout: margins, grid placement).
dataTableboolean—The "Show data" button (the table is in the page for screen readers either way). Default true.
descriptionReactNode—A sentence under the title: the period, the unit, the source.
emptyReactNode—What to show when there is nothing to draw (default: the empty label). An EmptyState of @krizaka /ui fits.
errorReactNode—The data could not be loaded: true says the default words, a node says yours (a retry button…).
exportableboolean | readonly ExportFormat[]—Export buttons: true for PNG, SVG and CSV, or the formats you want.
heightnumber—The height of the plot in pixels. Default 280 (a sparkline: 32).
hideSummaryboolean—Hide the total and the success rate above the bars.
hideTitleboolean—Visually hide the title (it stays the chart's accessible name): a card that already has its heading.
idstring—The id of the figure.
labelsPartial<ThroughputLabels>—The words, passed translated; English by default.
legendboolean—Show the legend (from two series). Default true.
liveboolean—Streaming data (a job queue, an auction): no entrance on updates, no announcement of every new point.
loadingboolean—The data is on its way: a skeleton of the chart, announced once.
localeLocale—The locale of every figure and date ("fr-FR"). Default "en-US".
markersreadonly Marker[]—Vertical markers at a category: a launch, an incident.
onSelect((datum: T, index: number) => void)—Called with the row when a point or a bar is clicked (or Enter is pressed on it).
periodCategoryFormatdayHow the periods are written. Default "day" (Oct 11); "time" for hours.
statusesreadonly JobStatus[][ { key: "completed", label: "Completed", tone: "success", outcome: "succeeded" }, { key: "failed", label: "Failed", tone: "danger", outcome: "failed" }, { key: "running", label: "Running", tone: "info" }, { key: "queued", label: "Queued", tone: "neutral" }, ]The statuses, in stacking order, with their field, name and tone. Default: completed, failed, running, queued.
styleCSSProperties—Inline style on the figure (layout only: colours come from the tokens).
summary"hidden" | "visible"—The written summary: read by screen readers only ("hidden", default), or shown under the chart ("visible").
summaryTextstring—Your own summary instead of the generated one (still read first by screen readers).
thresholdsreadonly Threshold[]—Horizontal lines at a value: a goal, a payout threshold.
xstring | ((datum: T, index: number) => unknown)"day" as Accessor<T, unknown>The field (or function) of the period. Default "day".
xLabelstring—The header of the categories in the data table (Month).
zeroboolean—Start the value axis at zero. Default: true for bars and areas; for lines, unless the values sit far from zero.

Accessibilité

  • The statuses wear the status tones and are named in the legend: the colour is never alone.
  • The total and the success rate are written above the chart, in words.

Clavier

TouchesAction
TabMoves the focus to the plot, then to the data and export buttons.
Arrow keysWalk the periods: each one's counts by status are announced.

Bonnes pratiques

  • Pass the statuses translated, in the order they should stack: the finished ones at the bottom.
  • Mark the statuses that end a job with outcome: only they count in the success rate.
  • Set live when the counts stream in: no entrance on every update.

Générée depuis le code de @krizaka/ui 3.6.0 : son meta.ts, ses exemples et ses types.Modifier cette documentation sur GitHub

Sur cette page