-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: abstract out types and utils
- Loading branch information
Showing
11 changed files
with
84 additions
and
84 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
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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import uPlot from "uplot" | ||
import { MetricType } from "./utils" | ||
|
||
export type Widget = { | ||
label: string | ||
description: string | ||
iconUrl: string | ||
isTableMetric: boolean | ||
getQuery: ({ | ||
tableId, | ||
sampleBy, | ||
limit, | ||
timeFilter, | ||
}: { | ||
tableId?: number | ||
sampleBy: string | ||
limit?: number | ||
timeFilter?: string | ||
}) => string | ||
getQueryLastNotNull: (id?: number) => string | ||
querySupportsRollingAppend: boolean | ||
alignData: (data: any) => uPlot.AlignedData | ||
mapYValue: (rawValue: number) => string | ||
} | ||
|
||
export type MetricsRefreshPayload = { | ||
dateFrom: string | ||
dateTo: string | ||
overwrite?: boolean | ||
} | ||
|
||
export type Duration = { | ||
dateFrom: string | ||
dateTo: string | ||
label: string | ||
} | ||
|
||
export type CommitRate = { | ||
created: string | ||
commit_rate: string | ||
commit_rate_smooth: string | ||
} | ||
|
||
export type WriteAmplification = { | ||
created: string | ||
writeAmplification: string | ||
} | ||
|
||
export type RowsApplied = { | ||
time: string | ||
numOfWalApplies: string | ||
numOfRowsApplied: string | ||
numOfRowsWritten: string | ||
avgWalAmplification: string | ||
} | ||
|
||
export type Latency = { | ||
created: string | ||
latency: string | ||
} | ||
|
||
export type LastNotNull = { | ||
created: string | ||
} | ||
|
||
export type ResultType = { | ||
[MetricType.COMMIT_RATE]: CommitRate | ||
[MetricType.LATENCY]: Latency | ||
[MetricType.WRITE_THROUGHPUT]: RowsApplied | ||
[MetricType.WRITE_AMPLIFICATION]: RowsApplied | ||
} |
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
3 changes: 1 addition & 2 deletions
3
packages/web-console/src/scenes/Editor/Metrics/widgets/commitRate.ts
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
4 changes: 2 additions & 2 deletions
4
packages/web-console/src/scenes/Editor/Metrics/widgets/latency.ts
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
3 changes: 1 addition & 2 deletions
3
packages/web-console/src/scenes/Editor/Metrics/widgets/writeAmplification.ts
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
4 changes: 2 additions & 2 deletions
4
packages/web-console/src/scenes/Editor/Metrics/widgets/writeThroughput.ts
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