-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add metric for missing messages
- Loading branch information
1 parent
2a29886
commit 1d60d2e
Showing
8 changed files
with
165 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
CREATE TABLE IF NOT EXISTS missingMessages ( | ||
id SERIAL PRIMARY KEY, | ||
messageHash TEXT NOT NULL, | ||
sentAt INTEGER NOT NULL, | ||
contentTopic TEXT NOT NULL, | ||
pubsubTopic TEXT NOT NULL, | ||
recordId INTEGER NOT NULL | ||
); | ||
|
||
ALTER TABLE missingMessages ADD CONSTRAINT fk_missingMessages_telemetryRecord | ||
FOREIGN KEY (recordId) REFERENCES telemetryRecord(id); | ||
|
||
ALTER TABLE missingMessages | ||
ADD CONSTRAINT missingMessages_unique | ||
UNIQUE ( | ||
recordId, | ||
messageHash, | ||
contentTopic | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS missingRelevantMessages ( | ||
id SERIAL PRIMARY KEY, | ||
messageHash TEXT NOT NULL, | ||
sentAt INTEGER NOT NULL, | ||
contentTopic TEXT NOT NULL, | ||
pubsubTopic TEXT NOT NULL, | ||
recordId INTEGER NOT NULL | ||
); | ||
|
||
ALTER TABLE missingRelevantMessages ADD CONSTRAINT fk_missingRelevantMessages_telemetryRecord | ||
FOREIGN KEY (recordId) REFERENCES telemetryRecord(id); | ||
|
||
ALTER TABLE missingRelevantMessages | ||
ADD CONSTRAINT missingRelevantMessages_unique | ||
UNIQUE ( | ||
recordId, | ||
messageHash, | ||
contentTopic | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package metrics | ||
|
||
import ( | ||
"github.com/status-im/telemetry/pkg/types" | ||
) | ||
|
||
type MissingMessage struct { | ||
GenericMetric[types.MissingMessage] | ||
} | ||
|
||
type MissingRelevantMessage struct { | ||
GenericMetric[types.MissingRelevantMessage] | ||
} | ||
|
||
var ( | ||
MissingMessageProcessor = &MissingMessage{} | ||
MissingRelevantMessageProcessor = &MissingRelevantMessage{} | ||
) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.