Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions build/src/catchers/catcher-message.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ export interface CatcherMessage<Type extends CatcherMessageType> {
* All information about the event
*/
payload: CatcherMessagePayload<Type>;
/**
* Number of identical occurrences this message represents.
* Computed on Catcher side to dedupe similar events caused in the same time.
*/
count?: number;
}
/**
* Type that represents a Catcher message accepted by the collector
Expand Down
6 changes: 6 additions & 0 deletions build/src/dbScheme/repetition.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ export interface RepetitionDBScheme {
* (created by the Collector)
*/
timestamp: number;
/**
* Number of real client-side occurrences merged into this single repetition
* by Catcher-side debounce (see CatcherMessage.count).
* Absent or 1 — this repetition represents a single occurrence.
*/
count?: number;
}
/**
* Repetition with decoded event data
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hawk.so/types",
"version": "0.6.3",
"version": "0.6.4",
"description": "TypeScript definitions for Hawk",
"types": "build/index.d.ts",
"main": "build/index.js",
Expand Down
6 changes: 6 additions & 0 deletions src/catchers/catcher-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ export interface CatcherMessage<Type extends CatcherMessageType> {
* All information about the event
*/
payload: CatcherMessagePayload<Type>;

/**
* Number of identical occurrences this message represents.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Number of identical occurrences this message represents.
* Number of identical occurrences this message represents. Computed on Catcher side to dedupe similar events caused in the same time.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

* Computed on Catcher side to dedupe similar events caused in the same time.
*/
count?: number;
}

/**
Expand Down
7 changes: 7 additions & 0 deletions src/dbScheme/repetition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ export interface RepetitionDBScheme {
* (created by the Collector)
*/
timestamp: number;

/**
* Number of real client-side occurrences merged into this single repetition
* by Catcher-side debounce (see CatcherMessage.count).
* Absent or 1 — this repetition represents a single occurrence.
*/
count?: number;
}

/**
Expand Down
Loading