Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • ddd ddd
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Custom issue tracker
    • Custom issue tracker
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • External wiki
    • External wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Commits
Collapse sidebar
  • repos
  • relengreleng
  • dddddd
  • Merge requests
  • !1

Build Workboard Metrics with boardmetrics.py

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged 20after4 requested to merge workboard-metrics into main Aug 17, 2021
  • Overview 27
  • Commits 4
  • Pipelines 0
  • Changes 15

The output is suitable for generating a timeline with data points for each time a task enters or leaves a column.

If you run the following command, a metrics.db will be created

./ddd/boardmetrics.py --project=PHID-PROJ-fmcvjrkfvvzz3gxavs3a --mock=test/train.transactions.json --dump=json > metrics.json

The schema for the sqlite database is as follows:

schema
events - individual datapoint for each task event (e.g. workboard move, status change
CREATE TABLE events(ts, task, project phid, user phid, event, old, new)
CREATE UNIQUE INDEX events_pk on events(ts, task, event)
column_metrics - metrics summarized by workboard columns
CREATE TABLE column_metrics (trnsid, ts, project phid, column phid, task, type, value)
CREATE UNIQUE INDEX trnsid on column_metrics(ts, column, task, value)
CREATE INDEX ts_column_value on column_metrics(column, task, ts, value)
task_metrics - metrics summarized by task
CREATE TABLE task_metrics(task, metric phid, next_metric phid, ts, ts2, duration)
CREATE UNIQUE INDEX task_metric ON task_metrics(task, metric)
Columns - duplicates information in phobjects table, will probably remove this in the future
CREATE TABLE columns(project,phid,name,status,proxyPHID,dateCreated,dateModified)
phobjects - cache of every phid to resolve object names and status of each referenced phid
CREATE TABLE phobjects (phid PRIMARY KEY,name TEXT,dateCreated timestamp,dateModified timestamp,status TEXT,type TEXT,data TEXT)
CREATE INDEX phid_name ON phobjects (phid, name)
CREATE UNIQUE INDEX pk_phobjects ON phobjects (phid)
CREATE INDEX type_status ON phobjects (type, status)
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: workboard-metrics