Skip to content

Commit

Permalink
chore(collector): add fmt job for collector CI (#1833)
Browse files Browse the repository at this point in the history
- Update collector README
- Update the url from github.com/pegasus-kv/collector to github.com/apache/incubator-pegasus/collector
- Add fmt job for collector CI
  • Loading branch information
acelyc111 authored Jan 5, 2024
1 parent 14ca78e commit 4093b4f
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 9 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/lint_and_test_collector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,32 @@ on:
paths:
- .github/workflows/lint_and_test_collector.yml
- collector/**
- go-client/**

# for manually triggering workflow
workflow_dispatch:

# workflow tasks
jobs:
format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Format
working-directory: ./go-client
run: |
gofmt -d .
test -z "$(gofmt -d .)"
lint:
name: Lint
needs: format
runs-on: ubuntu-20.04
steps:
- name: Checkout
Expand All @@ -58,6 +76,7 @@ jobs:

build:
name: Build
needs: lint
runs-on: ubuntu-20.04
steps:
- name: Checkout
Expand Down
16 changes: 16 additions & 0 deletions collector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,19 @@ Collector is a part of the Pegasus ecosystem that serves as:
1. the service availability detector
2. the hotkey detector
3. the capacity units recorder

## Requirement

- Go1.18+

## Development

Build the collector:
```bash
make build
```

Format the code:
```bash
make fmt
```
2 changes: 1 addition & 1 deletion collector/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

module github.com/pegasus-kv/collector
module github.com/apache/incubator-pegasus/collector

go 1.18

Expand Down
6 changes: 3 additions & 3 deletions collector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (
"strings"
"syscall"

"github.com/pegasus-kv/collector/avail"
"github.com/pegasus-kv/collector/metrics"
"github.com/pegasus-kv/collector/webui"
"github.com/apache/incubator-pegasus/collector/avail"
"github.com/apache/incubator-pegasus/collector/metrics"
"github.com/apache/incubator-pegasus/collector/webui"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
"gopkg.in/natefinch/lumberjack.v2"
Expand Down
2 changes: 1 addition & 1 deletion collector/sink/falcon_sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"net/http"
"time"

"github.com/pegasus-kv/collector/aggregate"
"github.com/apache/incubator-pegasus/collector/aggregate"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
)
Expand Down
2 changes: 1 addition & 1 deletion collector/sink/prometheus_sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package sink
import (
"sync"

"github.com/pegasus-kv/collector/aggregate"
"github.com/apache/incubator-pegasus/collector/aggregate"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down
2 changes: 1 addition & 1 deletion collector/sink/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package sink

import (
"github.com/pegasus-kv/collector/aggregate"
"github.com/apache/incubator-pegasus/collector/aggregate"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
)
Expand Down
2 changes: 1 addition & 1 deletion collector/usage/usage_recorder.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"fmt"
"time"

"github.com/apache/incubator-pegasus/collector/aggregate"
"github.com/apache/incubator-pegasus/go-client/pegasus"
"github.com/pegasus-kv/collector/aggregate"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
"gopkg.in/tomb.v2"
Expand Down
2 changes: 1 addition & 1 deletion collector/webui/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
package webui

import (
"github.com/apache/incubator-pegasus/collector/aggregate"
"github.com/kataras/iris/v12"
"github.com/pegasus-kv/collector/aggregate"
)

var indexPageClusterStats = []string{
Expand Down

0 comments on commit 4093b4f

Please sign in to comment.