PageSourceSearch

https://flanksource.com/assets/js/f3adf3c2.d8c5d132.js

js flanksource.com collected 2026-10-03 20:52:11 UTC 5,502 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkmission_control=globalThis.webpackChunkmission_control||[]).push([[407],{15313(e,n,t){t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>o,default:()=>p,frontMatter:()=>a,metadata:()=>i,toc:()=>d});const i=JSON.parse('{"id":"guide/views/panels/duration","title":"Duration","description":"The duration panel displays time duration values in a human-readable format (e.g., \\"2h 30m\\"). It has no additional configuration properties.","source":"@site/docs/guide/views/panels/duration.md","sourceDirName":"guide/views/panels","slug":"/guide/views/panels/duration","permalink":"/docs/guide/views/panels/duration","draft":false,"unlisted":false,"editUrl":"https://github.com/flanksource/docs/tree/main/docs/guide/views/panels/duration.md","tags":[],"version":"current","frontMatter":{"title":"Duration","sidebar_custom_props":{"icon":"mdi:timer-outline"}},"sidebar":"guide","previous":{"title":"Bar Gauge","permalink":"/docs/guide/views/panels/bargauge"},"next":{"title":"Gauge","permalink":"/docs/guide/views/panels/gauge"}}');var s=t(74848),r=t(28453);const a={title:"Duration",sidebar_custom_props:{icon:"mdi:timer-outline"}},o=void 0,l={},d=[{value:"Expected Columns",id:"expected-columns",level:2},{value:"Example",id:"example",level:2}];function c(e){const n={code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"duration"}),' panel displays time duration values in a human-readable format (e.g., "2h 30m"). It has no additional configuration properties.']}),"\n",(0,s.jsx)(n.h2,{id:"expected-columns",children:"Expected Columns"}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Column"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"value"})}),(0,s.jsx)(n.td,{children:"number"}),(0,s.jsxs)(n.td,{children:["Duration in ",(0,s.jsx)(n.strong,{children:"nanoseconds"})," (required)"]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"label"})}),(0,s.jsx)(n.td,{children:"string"}),(0,s.jsx)(n.td,{children:"Optional per-row label (defaults to the panel name)"})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-yaml",metastring:'title="pipelines.yaml" file=<rootDir>/modules/mission-control/fixtures/views/pipelines.yaml',children:"apiVersion: mission-control.flanksource.com/v1\nkind: View\nmetadata:\n  name: pipelines\n  namespace: mc\nspec:\n  display:\n    title: Pipelines\n    icon: github\n    sidebar: true\n    table:\n      sort: \"-lastRun\"\n      size: 5\n  cache:\n    maxAge: 30m\n    minAge: 1m\n    refreshTimeout: 30s\n  panels:\n    - name: Repository\n      type: table\n      query: SELECT COUNT(*) AS value, details->'repository'->>'full_name' as repository FROM workflows GROUP BY details->'repository'->>'full_name'\n    - name: Average Duration\n      description: Create Release average duration\n      type: duration\n      query: >\n        SELECT AVG(details->'duration') AS value, details->'repository'->>'full_name' as label\n        FROM workflows GROUP BY details->'repository'->>'full_name'\n  columns:\n    - name: id\n      type: string\n      description: The id of the pipeline.\n      primaryKey: true\n      hidden: true\n    - name: repository\n      type: string\n      description: The repository of the pipeline.\n      width: \"2\"\n      filter:\n        type: multiselect\n    - name: name\n      type: string\n      description: The name of the pipeline.\n      width: \"3\"\n      filter:\n        type: multiselect\n    - name: lastRun\n      type: datetime\n      description: The namespace name.\n      width: \"2\"\n    - name: lastRunBy\n      type: string\n      description: The chart name.\n      width: \"2\"\n      filter:\n        type: multiselect\n    - name: duration\n      type: duration\n      width: \"1\"\n      description: The duration of the pipeline.\n    - name: status\n      type: status\n      width: \"1\"\n      description: The status of the pipeline.\n      filter:\n        type: multiselect\n  queries:\n    workflows:\n      changes:\n        limit: 10\n        search: change_type=GitHubActionRun* @order=-created_at\n        types:\n          - GitHubAction::Workflow\n  mapping:\n    name: row.name.split('/')[1]\n    lastRun: row.details.created_at\n    lastRunBy: row.details.triggering_actor.login\n    repository: row.details.repository.full_name\n    status: >\n      has(row.details.conclusion) ? row.details.conclusion : 'pending'\n    duration: timestamp(row.details.updated_at) - timestamp(row.details.run_started_at)\n"})})]})}function p(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},28453(e,n,t){t.d(n,{R:()=>a,x:()=>o});var i=t(96540);const s={},r=i.createContext(s);function a(e){const n=i.useContext(r);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.