Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing score on peer_score table #2

Merged
merged 2 commits into from
May 23, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion db.go
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@ var eventDefs = map[EventType]EventDef{
peer_id TEXT NOT NULL,
timestamp TIMESTAMPTZ NOT NULL,
other_peer_id TEXT NOT NULL,
score FLOAT8 NOT NULL,
app_specific_score FLOAT8 NOT NULL,
ip_colocation_factor FLOAT8 NOT NULL,
behaviour_penalty FLOAT8 NOT NULL,
Expand Down Expand Up @@ -712,7 +713,7 @@ var eventDefs = map[EventType]EventDef{
logger := slog.With("event_type", "peer_score")
b := new(pgx.Batch)

parentCols := []string{"peer_id", "timestamp", "other_peer_id", "app_specific_score", "ip_colocation_factor", "behaviour_penalty"}
parentCols := []string{"peer_id", "timestamp", "other_peer_id", "score", "app_specific_score", "ip_colocation_factor", "behaviour_penalty"}
childCols := []string{"peer_score_event_id", "topic", "time_in_mesh", "first_message_deliveries", "mesh_message_deliveries", "invalid_message_deliveries"}

eventCount := 0
Expand Down Expand Up @@ -766,6 +767,7 @@ var eventDefs = map[EventType]EventDef{
peerID.String(),
time.Unix(0, *ev.Timestamp),
otherPeerID.String(),
sub.Score,
sub.AppSpecificScore,
sub.IPColocationFactor,
sub.BehaviourPenalty,
Expand Down