gha-timegraph

command module
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2024 License: MIT Imports: 1 Imported by: 0

README

gha-timegraph

Overview

Graphs the execution time of GitHub Actions.

Img

Installation

You can install with Homebrew.

brew install koh-sh/tap/gha-timegraph

Or download prebuild binary from Releases

Usage

Graphs the execution time of GitHub Actions.

It creates GitHub Actions execution time as PNG graph.
Set GITHUB_TOKEN for private repositories.

Usage:
  gha-timegraph [flags]

Flags:
      --branch string     Branch name to filter results
      --count int         count of Workflow runs (default 30)
  -h, --help              help for gha-timegraph
      --out string        format of output 'png|csv|table|json' (default "png")
      --outfile string    name of output png file (default "graph.png")
      --owner string      Owner of the Action (Required)
      --repo string       Repository of the Action (Required)
      --silent            Hide Progress bar for GitHub API
  -t, --toggle            Help message for toggle
  -v, --version           version for gha-timegraph
      --workflow string   workflow filename of the Action (Required)

QuickStart

Create PNG graph with the command

Run this command with options would create png graph of GitHub Actions execution time.

% gha-timegraph --owner koh-sh --repo codebuild-multirunner --workflow go-test.yml
PNG save to graph.png
% ls -l graph.png
-rw-r--r--@ 1 koh  staff  43189 Nov  5 15:56 graph.png
Use options to change plot counts or filter branch
      --branch string     Branch name to filter results
      --count int         count of Workflow runs (default 30)
Set GITHUB_TOKEN for private repositories

Or If you hit API rate limit, set GITHUB_TOKEN and retry.

% export GITHUB_TOKEN="your Personal Access Token"
% gha-timegraph --owner koh-sh --repo [name of private repo] --workflow go-test.yml

Dump data other than PNG

Currently it supports CSV, MarkDown Table, and Json output too.

% gha-timegraph --owner koh-sh --repo codebuild-multirunner --workflow go-test.yml --count 10 --out csv
Name,StartTime(UTC),Elapsed
Go Test,2023-11-03 21:48:53,65
Go Test,2023-11-03 21:48:45,48
Go Test,2023-11-03 21:47:39,103
Go Test,2023-11-03 21:46:10,51
Go Test,2023-10-27 21:35:57,59
Go Test,2023-10-20 21:40:23,88
Go Test,2023-10-14 13:51:03,74
Go Test,2023-10-14 13:47:52,61
Go Test,2023-10-14 13:47:06,69
Go Test,2023-10-14 13:44:32,82

Documentation

Overview

Copyright © 2023 koh-sh

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis
internal
gha

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL