openalysis

command module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

README

OPENALYSIS

You Can (Not) Observe

OPENALYSIS

Open Analysis Service

Install

  • Install CMD Tool
go install github.com/B1NARY-GR0UP/openalysis@latest
  • Get Library
go get -u github.com/B1NARY-GR0UP/openalysis
  • Do not have a Go environment? Check the Quick Start section.

Usage (CMD Tool)

  • Start: Start OPENALYSIS service
  • Restart: Restart OPENALYSIS service
Usage:        
  openalysis [command]

Available Commands:
  help        Help about any command
  restart     restart openalysis service
  start       start openalysis service

Flags:
  -h, --help      help for openalysis
  -v, --version   version for openalysis

NOTE:

1. All configurations are based on the configuration file, and if flags are set, they will override the configurations in the configuration file.

2. If the configuration file path is not specified, the project's default configuration file will be used.

Start - Start OPENALYSIS service
  • Usage
openalysis start [flags] [path2config]
  • Flags
Short Long Description
-t --token Your GitHub Token
-c --cron Your Cron Spec
-r --retry Retry Times
-h --help Help for Start
  • Example
openalysis start -c "@hourly" -r "5" config.yaml
Restart - Restart OPENALYSIS service
  • Usage
openalysis restart [flags] [path2config]
  • Flags
Short Long Description
-t --token Your GitHub Token
-c --cron Your Cron Spec
-r --retry Retry Times
-h --help Help for Restart
  • Example
openalysis restart -t "example-github-token"
Sample Configuration File
  • groups

Configure the organization or repository you want to analyze on a group basis.

You can set up multiple groups, where each group can contain multiple organizations or repositories.

  • datasource

The configuration for MySQL, will be used as a datasource for Grafana.

  • backend

The backend configuration for the service includes settings for cron, GitHub token, and retry attempts.

  • cleaner

The configuration for unifying contributor's location and company information.

groups:
  - name: "cloudwego"
    orgs:
      - "cloudwego"
      - "kitex-contrib"
      - "hertz-contrib"
      - "volo-rs"
    repos:
      - "bytedance/sonic"
      - "bytedance/monoio"
datasource:
  mysql:
    host: "mysql"
    port: "3306"
    user: "openalysis"
    password: "openalysis"
    database: "openalysis?charset=utf8&parseTime=True&loc=Local"
backend:
  cron: "@daily"
  token: "your-github-token"
  retry: 3
# "`Before` => `After`"
cleaner:
  - "`@CloudWeGo` => `CloudWeGo`"
  - "`@cloudwego` => `CloudWeGo`"

Quick Start

Step 1: Create GitHub Token

Create a fine-grained personal access token.

Step 2: Start Service
  • Use Docker-Compose

Config the command in the openalysis service.

docker-compose up --build
  • Build from Dockerfile

Start your MySQL and Grafana.

docker build -t openalysis .
docker run -it -v path2config.yaml:/src openalysis start path2config.yaml
Step 3: Config Grafana
  1. Visit 127.0.0.1:3000 on browser
  2. Add MySQL Datasource
  3. Import template in template folder

Dashboard Effect Display

example-1

example-2

example-3

example-3

Acknowledgement

Sincere appreciation to the CloudWeGo community, without whose help this project would not have been possible.

License

OPENALYSIS is distributed under the Apache License 2.0. The licenses of third party dependencies of OPENALYSIS are explained here.

ECOLOGY

BINARY-WEB-ECO

OPENALYSIS is a Subproject of the BINARY WEB ECOLOGY

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
client
pkg

Jump to

Keyboard shortcuts

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