-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: could not aggregate event-level data in a stats manager, bad…
… wording of stats classes Solution: add tickStats as an event-level aggregator without TimeFrames and integrate with accountTimeSeries.ts; rename timeSeries.ts to timeFrameStats.ts and related classes; also add docs
- Loading branch information
1 parent
ff41b33
commit 3d4eeee
Showing
17 changed files
with
9,645 additions
and
619 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export * from './statsState.js' | ||
export * from './statsTimeSeries.js' | ||
export * from "./timeFrameState.js"; | ||
export * from "./timeFrameEntity.js"; |
This file was deleted.
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,33 @@ | ||
import { EntityStorage } from "@aleph-indexer/core"; | ||
|
||
export type TickEntity<T> = { | ||
account: string | ||
type: string | ||
date: number | ||
data: T | ||
} | ||
|
||
export type TickStatsStorage = EntityStorage<TickEntity<any>> | ||
|
||
const accountKey = { | ||
get: (e: TickEntity<unknown>) => e.account, | ||
length: EntityStorage.AddressLength | ||
}; | ||
|
||
const typeKey = { | ||
get: (e: TickEntity<unknown>) => e.type, | ||
length: EntityStorage.VariableLength | ||
}; | ||
|
||
const dateKey = { | ||
get: (e: TickEntity<unknown>) => e.date, | ||
length: EntityStorage.TimestampLength | ||
}; | ||
|
||
export function createStatsTimeSeriesDAL(path: string): TickStatsStorage { | ||
return new EntityStorage<TickEntity<any>>({ | ||
name: "stats_time_series", | ||
path, | ||
key: [accountKey, typeKey, dateKey] | ||
}); | ||
} |
Oops, something went wrong.