robgutsopedra commented on issue #4889:
URL: 
https://github.com/apache/incubator-devlake/issues/4889#issuecomment-1501670212

   `{
       "annotations": {
         "list": [
           {
             "builtIn": 1,
             "datasource": "-- Grafana --",
             "enable": true,
             "hide": true,
             "iconColor": "rgba(0, 211, 255, 1)",
             "name": "Annotations & Alerts",
             "type": "dashboard"
           }
         ]
       },
       "editable": true,
       "gnetId": null,
       "graphTooltip": 0,
       "id": 28,
       "iteration": 1681123370748,
       "links": [],
       "panels": [
         {
           "datasource": null,
           "gridPos": {
             "h": 3,
             "w": 24,
             "x": 0,
             "y": 0
           },
           "id": 8,
           "options": {
             "content": "- Use Cases: This dashboard presents some metrics 
about your workflows. \n- Data Source Required: GitHub \n- This panel is still 
being built",
             "mode": "markdown"
           },
           "pluginVersion": "8.0.6",
           "targets": [
             {
               "queryType": "randomWalk",
               "refId": "A"
             }
           ],
           "title": "Dashboard Introduction",
           "type": "text"
         },
         {
           "collapsed": false,
           "datasource": null,
           "gridPos": {
             "h": 1,
             "w": 24,
             "x": 0,
             "y": 3
           },
           "id": 6,
           "panels": [],
           "title": "Workflow metrics",
           "type": "row"
         },
         {
           "datasource": "mysql",
           "fieldConfig": {
             "defaults": {
               "color": {
                 "mode": "palette-classic"
               },
               "custom": {
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
                 "drawStyle": "line",
                 "fillOpacity": 0,
                 "gradientMode": "none",
                 "hideFrom": {
                   "legend": false,
                   "tooltip": false,
                   "viz": false
                 },
                 "lineInterpolation": "linear",
                 "lineWidth": 1,
                 "pointSize": 5,
                 "scaleDistribution": {
                   "type": "linear"
                 },
                 "showPoints": "auto",
                 "spanNulls": false,
                 "stacking": {
                   "group": "A",
                   "mode": "none"
                 },
                 "thresholdsStyle": {
                   "mode": "off"
                 }
               },
               "mappings": [],
               "thresholds": {
                 "mode": "absolute",
                 "steps": [
                   {
                     "color": "green",
                     "value": null
                   },
                   {
                     "color": "red",
                     "value": 80
                   }
                 ]
               }
             },
             "overrides": []
           },
           "gridPos": {
             "h": 9,
             "w": 24,
             "x": 0,
             "y": 4
           },
           "id": 2,
           "options": {
             "legend": {
               "calcs": [],
               "displayMode": "list",
               "placement": "bottom",
               "showLegend": true
             },
             "tooltip": {
               "mode": "single",
               "sort": "none"
             }
           },
           "targets": [
             {
               "format": "time_series",
               "group": [],
               "hide": false,
               "metricColumn": "none",
               "rawQuery": true,
               "rawSql": "SELECT \n  DATE_ADD(date(cicd.started_date), INTERVAL 
-DAY(date(cicd.started_date))+1 DAY) as time,\n  AVG(duration_sec) as 
avg_duration\nFROM \n  cicd_tasks as cicd\n  join project_mapping pm on 
cicd.cicd_scope_id = pm.row_id\nWHERE \n  duration_sec < 10000 and \n  
pm.project_name in ($project) and\n  $__timeFilter(cicd.started_date)\nGROUP BY 
time\norder by time",
               "refId": "A",
               "select": [
                 [
                   {
                     "params": [
                       "blueprint_id"
                     ],
                     "type": "column"
                   }
                 ]
               ],
               "table": "_devlake_blueprint_labels",
               "timeColumn": "created_at",
               "timeColumnType": "timestamp",
               "where": [
                 {
                   "name": "$__timeFilter",
                   "params": [],
                   "type": "macro"
                 }
               ]
             }
           ],
           "title": "Average duration of workflows through time",
           "type": "timeseries"
         },
         {
           "datasource": "mysql",
           "fieldConfig": {
             "defaults": {
               "color": {
                 "mode": "thresholds"
               },
               "custom": {
                 "align": "auto",
                 "displayMode": "auto"
               },
               "mappings": [],
               "thresholds": {
                 "mode": "absolute",
                 "steps": [
                   {
                     "color": "green",
                     "value": null
                   },
                   {
                     "color": "red",
                     "value": 80
                   }
                 ]
               },
               "unit": "s"
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
             "w": 24,
             "x": 0,
             "y": 13
           },
           "id": 4,
           "options": {
             "footer": {
               "countRows": false,
               "enablePagination": false,
               "fields": "",
               "reducer": [
                 "sum"
               ],
               "show": false
             },
             "showHeader": true
           },
           "pluginVersion": "8.0.6",
           "targets": [
             {
               "datasource": "mysql",
               "editorMode": "code",
               "format": "table",
               "rawQuery": true,
               "rawSql": "SELECT \n  cs.name as repo_name,\n  cicd.name as 
workflow_name,\n  AVG(duration_sec) as avg_duration\nFROM lake.cicd_tasks as 
cicd\n  JOIN cicd_scopes cs \non cs.id = cicd_scope_id\n  join project_mapping 
pm on cicd.cicd_scope_id = pm.row_id \nWHERE \n  duration_sec < 10000 AND \n  
pm.project_name in ($project)\nGROUP by repo_name,workflow_name\nORDER BY 
avg_duration DESC\nLIMIT 40",
               "refId": "A",
               "sql": {
                 "columns": [
                   {
                     "parameters": [],
                     "type": "function"
                   }
                 ],
                 "groupBy": [
                   {
                     "property": {
                       "type": "string"
                     },
                     "type": "groupBy"
                   }
                 ],
                 "limit": 50
               }
             }
           ],
           "title": "Top 40 slowest workflows",
           "type": "table"
         }
       ],
       "refresh": false,
       "revision": 1,
       "schemaVersion": 30,
       "style": "dark",
       "tags": [],
       "templating": {
         "list": [
           {
             "allValue": null,
             "current": {
               "selected": true,
               "text": [
                 "ultimateai"
               ],
               "value": [
                 "ultimateai"
               ]
             },
             "datasource": "mysql",
             "definition": "select distinct name from projects",
             "description": null,
             "error": null,
             "hide": 0,
             "includeAll": true,
             "label": "Project",
             "multi": true,
             "name": "project",
             "options": [],
             "query": "select distinct name from projects",
             "refresh": 1,
             "regex": "",
             "skipUrlSync": false,
             "sort": 0,
             "type": "query"
           },
           {
             "allValue": null,
             "current": {
               "selected": false,
               "text": "2023-04",
               "value": "2023-04-01"
             },
             "datasource": "mysql",
             "definition": "select\n  
distinct(concat(date_format(DATE_ADD(date(created_date), INTERVAL 
-DAY(date(created_date))+1 DAY), '%Y-%m') , ':', 
date_format(DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 
DAY), '%Y-%m-%d'))) as month\nfrom\n  lake.issues i\norder by month desc",
             "description": null,
             "error": null,
             "hide": 0,
             "includeAll": false,
             "label": "Month",
             "multi": false,
             "name": "month",
             "options": [],
             "query": "select\n  
distinct(concat(date_format(DATE_ADD(date(created_date), INTERVAL 
-DAY(date(created_date))+1 DAY), '%Y-%m') , ':', 
date_format(DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 
DAY), '%Y-%m-%d'))) as month\nfrom\n  lake.issues i\norder by month desc",
             "refresh": 1,
             "regex": "/^(?<text>.*):(?<value>.*)$/",
             "skipUrlSync": false,
             "sort": 0,
             "type": "query"
           }
         ]
       },
       "time": {
         "from": "now-6M",
         "to": "now"
       },
       "timepicker": {},
       "timezone": "",
       "title": "WIP - workflow metrics",
       "uid": "K8VkM8Y4k",
       "version": 4
     }`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to