feat(core): Workflow Execution Statistics (#4200)

Add recording and reporting of workflow execution statistics
This commit is contained in:
freya
2022-12-06 14:55:40 +00:00
committed by GitHub
parent b71295e4de
commit 1722c6b0c5
28 changed files with 908 additions and 66 deletions

View File

@@ -13,6 +13,7 @@ import {
Column,
Entity,
Index,
JoinColumn,
JoinTable,
ManyToMany,
OneToMany,
@@ -24,6 +25,7 @@ import { TagEntity } from './TagEntity';
import { SharedWorkflow } from './SharedWorkflow';
import { objectRetriever, sqlite } from '../utils/transformers';
import { AbstractEntity, jsonColumnType } from './AbstractEntity';
import { WorkflowStatistics } from './WorkflowStatistics';
import type { IWorkflowDb } from '@/Interfaces';
@Entity()
@@ -78,6 +80,16 @@ export class WorkflowEntity extends AbstractEntity implements IWorkflowDb {
@OneToMany(() => SharedWorkflow, (sharedWorkflow) => sharedWorkflow.workflow)
shared: SharedWorkflow[];
@OneToMany(
() => WorkflowStatistics,
(workflowStatistics: WorkflowStatistics) => workflowStatistics.workflow,
)
@JoinColumn({ referencedColumnName: 'workflow' })
statistics: WorkflowStatistics[];
@Column({ default: false })
dataLoaded: boolean;
@Column({
type: config.getEnv('database.type') === 'sqlite' ? 'text' : 'json',
nullable: true,