Skip to content

Commit

Permalink
all: move alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
n8maninger committed Oct 31, 2023
1 parent 3c0ffda commit 901d957
Show file tree
Hide file tree
Showing 19 changed files with 53 additions and 17 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"go.sia.tech/core/consensus"
rhp3 "go.sia.tech/core/rhp/v3"
"go.sia.tech/core/types"
"go.sia.tech/hostd/alerts"
"go.sia.tech/hostd/host/accounts"
"go.sia.tech/hostd/host/alerts"
"go.sia.tech/hostd/host/contracts"
"go.sia.tech/hostd/host/metrics"
"go.sia.tech/hostd/host/settings"
Expand Down
2 changes: 1 addition & 1 deletion cmd/hostd/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"strings"

"go.sia.tech/core/types"
"go.sia.tech/hostd/alerts"
"go.sia.tech/hostd/host/accounts"
"go.sia.tech/hostd/host/alerts"
"go.sia.tech/hostd/host/contracts"
"go.sia.tech/hostd/host/metrics"
"go.sia.tech/hostd/host/registry"
Expand Down
36 changes: 36 additions & 0 deletions cmd/logparse/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package main

import (
"encoding/json"
"os"
"strconv"
)

func main() {
f, err := os.Open("/Users/n8maninger/Downloads/hostd.log")
if err != nil {
panic(err)
}
defer f.Close()

dec := json.NewDecoder(f)

enc := json.NewEncoder(os.Stdout)
enc.SetIndent("", " ")

for {
var v map[string]any
if err := dec.Decode(&v); err != nil {
break
}

ts, _ := v["ts"].(string)
f, err := strconv.ParseFloat(ts, 64)
if err != nil {
continue
} else if f < 1693360589.0406103 {
continue
}
enc.Encode(v)
}
}
2 changes: 1 addition & 1 deletion host/accounts/accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"time"

"go.sia.tech/core/types"
"go.sia.tech/hostd/alerts"
"go.sia.tech/hostd/host/accounts"
"go.sia.tech/hostd/host/alerts"
"go.sia.tech/hostd/host/contracts"
"go.sia.tech/hostd/host/settings"
"go.sia.tech/hostd/host/storage"
Expand Down
2 changes: 1 addition & 1 deletion host/accounts/budget_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"time"

"go.sia.tech/core/types"
"go.sia.tech/hostd/alerts"
"go.sia.tech/hostd/host/accounts"
"go.sia.tech/hostd/host/alerts"
"go.sia.tech/hostd/host/contracts"
"go.sia.tech/hostd/host/storage"
"go.sia.tech/hostd/internal/chain"
Expand Down
2 changes: 1 addition & 1 deletion host/contracts/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

rhp2 "go.sia.tech/core/rhp/v2"
"go.sia.tech/core/types"
"go.sia.tech/hostd/host/alerts"
"go.sia.tech/hostd/alerts"
"go.uber.org/zap"
"lukechampine.com/frand"
)
Expand Down
2 changes: 1 addition & 1 deletion host/contracts/contracts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

rhp2 "go.sia.tech/core/rhp/v2"
"go.sia.tech/core/types"
"go.sia.tech/hostd/host/alerts"
"go.sia.tech/hostd/alerts"
"go.sia.tech/hostd/host/contracts"
"go.sia.tech/hostd/host/storage"
"go.sia.tech/hostd/internal/test"
Expand Down
2 changes: 1 addition & 1 deletion host/contracts/integrity.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

rhp2 "go.sia.tech/core/rhp/v2"
"go.sia.tech/core/types"
"go.sia.tech/hostd/host/alerts"
"go.sia.tech/hostd/alerts"
"go.uber.org/zap"
"lukechampine.com/frand"
)
Expand Down
2 changes: 1 addition & 1 deletion host/contracts/integrity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

rhp2 "go.sia.tech/core/rhp/v2"
"go.sia.tech/core/types"
"go.sia.tech/hostd/host/alerts"
"go.sia.tech/hostd/alerts"
"go.sia.tech/hostd/host/contracts"
"go.sia.tech/hostd/host/storage"
"go.sia.tech/hostd/internal/test"
Expand Down
2 changes: 1 addition & 1 deletion host/contracts/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"go.sia.tech/core/consensus"
rhp2 "go.sia.tech/core/rhp/v2"
"go.sia.tech/core/types"
"go.sia.tech/hostd/host/alerts"
"go.sia.tech/hostd/alerts"
"go.sia.tech/hostd/internal/chain"
"go.sia.tech/hostd/internal/threadgroup"
"go.sia.tech/siad/modules"
Expand Down
2 changes: 1 addition & 1 deletion host/contracts/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

rhp2 "go.sia.tech/core/rhp/v2"
"go.sia.tech/core/types"
"go.sia.tech/hostd/host/alerts"
"go.sia.tech/hostd/alerts"
"go.sia.tech/hostd/host/contracts"
"go.sia.tech/hostd/host/storage"
"go.sia.tech/hostd/internal/test"
Expand Down
2 changes: 1 addition & 1 deletion host/settings/announce.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"

"go.sia.tech/core/types"
"go.sia.tech/hostd/host/alerts"
"go.sia.tech/hostd/alerts"
"go.sia.tech/siad/modules"
stypes "go.sia.tech/siad/types"
"go.uber.org/zap"
Expand Down
2 changes: 1 addition & 1 deletion host/settings/announce_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"

"go.sia.tech/core/types"
"go.sia.tech/hostd/host/alerts"
"go.sia.tech/hostd/alerts"
"go.sia.tech/hostd/host/settings"
"go.sia.tech/hostd/internal/test"
"go.sia.tech/hostd/persist/sqlite"
Expand Down
2 changes: 1 addition & 1 deletion host/settings/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"go.sia.tech/core/consensus"
"go.sia.tech/core/types"
"go.sia.tech/hostd/host/alerts"
"go.sia.tech/hostd/alerts"
"go.sia.tech/hostd/internal/chain"
"go.sia.tech/hostd/internal/threadgroup"
"go.sia.tech/siad/modules"
Expand Down
2 changes: 1 addition & 1 deletion host/settings/settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"go.sia.tech/core/types"
"go.sia.tech/hostd/host/alerts"
"go.sia.tech/hostd/alerts"
"go.sia.tech/hostd/host/settings"
"go.sia.tech/hostd/internal/test"
"go.sia.tech/hostd/persist/sqlite"
Expand Down
2 changes: 1 addition & 1 deletion host/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"go.sia.tech/core/consensus"
rhp2 "go.sia.tech/core/rhp/v2"
"go.sia.tech/core/types"
"go.sia.tech/hostd/host/alerts"
"go.sia.tech/hostd/alerts"
"go.sia.tech/hostd/internal/threadgroup"
"go.sia.tech/siad/modules"
"go.uber.org/zap"
Expand Down
2 changes: 1 addition & 1 deletion host/storage/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

rhp2 "go.sia.tech/core/rhp/v2"
"go.sia.tech/core/types"
"go.sia.tech/hostd/host/alerts"
"go.sia.tech/hostd/alerts"
"go.sia.tech/hostd/host/storage"
"go.sia.tech/hostd/internal/chain"
"go.sia.tech/hostd/persist/sqlite"
Expand Down
2 changes: 1 addition & 1 deletion internal/test/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
crhp2 "go.sia.tech/core/rhp/v2"
crhp3 "go.sia.tech/core/rhp/v3"
"go.sia.tech/core/types"
"go.sia.tech/hostd/alerts"
"go.sia.tech/hostd/host/accounts"
"go.sia.tech/hostd/host/alerts"
"go.sia.tech/hostd/host/contracts"
"go.sia.tech/hostd/host/registry"
"go.sia.tech/hostd/host/settings"
Expand Down

0 comments on commit 901d957

Please sign in to comment.