Skip to main content

Duration

The duration column type displays time spans in human-readable format (e.g., 2h 30m, 1d). Values are expected in nanoseconds.

FieldDescriptionScheme
name*

Column name (must be a valid SQL identifier)

string

type*

Data type that controls formatting and visualization

string | number | boolean | datetime | duration | health | status | gauge | bytes | decimal | millicore | config_item | labels | badge

badge

Badge styling configuration. Use color.auto for heuristic coloring or color.map for explicit value-to-color mappings.

BadgeConfig

card.position

Where this column appears in the card layout: title, subtitle, deck, body, footer, or headerRight

string

card.useForAccent

Set to true to use this column's value as the accent color for the card (typically used on health or status columns)

boolean

description

Human-readable help text for the column

string

filter

Enable server-side filtering for this column. Set filter.type: multiselect to let users include or exclude values without re-running the query.

object

hidden

Hide the column from the table view (default: false)

boolean

icon

CEL expression that resolves to an icon name per row (e.g. row.type)

string

primaryKey

Whether this column is part of the primary key (default: false). At least one column must be marked as primary key.

boolean

unit

Unit label appended to the displayed value (e.g. %, MB, pods)

string

url

Link to a config, another view, or a custom URL using CEL / Go templates

ColumnURL

width

Display width, e.g. 150px or a flex weight like 2

string

Example

pipelines.yaml
apiVersion: mission-control.flanksource.com/v1
kind: View
metadata:
name: pipelines
namespace: mc
spec:
display:
title: Pipelines
icon: github
sidebar: true
table:
sort: "-lastRun"
size: 5
cache:
maxAge: 30m
minAge: 1m
refreshTimeout: 30s
panels:
- name: Repository
type: table
query: SELECT COUNT(*) AS value, details->'repository'->>'full_name' as repository FROM workflows GROUP BY details->'repository'->>'full_name'
- name: Average Duration
description: Create Release average duration
type: duration
query: >
SELECT AVG(details->'duration') AS value, details->'repository'->>'full_name' as label
FROM workflows GROUP BY details->'repository'->>'full_name'
columns:
- name: id
type: string
description: The id of the pipeline.
primaryKey: true
hidden: true
- name: repository
type: string
description: The repository of the pipeline.
width: "2"
filter:
type: multiselect
- name: name
type: string
description: The name of the pipeline.
width: "3"
filter:
type: multiselect
- name: lastRun
type: datetime
description: The namespace name.
width: "2"
- name: lastRunBy
type: string
description: The chart name.
width: "2"
filter:
type: multiselect
- name: duration
type: duration
width: "1"
description: The duration of the pipeline.
- name: status
type: status
width: "1"
description: The status of the pipeline.
filter:
type: multiselect
queries:
workflows:
changes:
limit: 10
search: change_type=GitHubActionRun* @order=-created_at
types:
- GitHubAction::Workflow
mapping:
name: row.name.split('/')[1]
lastRun: row.details.created_at
lastRunBy: row.details.triggering_actor.login
repository: row.details.repository.full_name
status: >
has(row.details.conclusion) ? row.details.conclusion : 'pending'
duration: timestamp(row.details.updated_at) - timestamp(row.details.run_started_at)